Repository navigation
diff: pass --no-color so forced git colors do not empty the diff body - #96363
Merged
Merged
Conversation
poteat
enabled auto-merge (rebase)
September 23, 2026 13:39
stephanien-ant
approved these changes
Sep 23, 2026
This was referenced Sep 23, 2026
notitatall
approved these changes
Sep 24, 2026
This was referenced Sep 24, 2026
1 task
This was referenced Sep 29, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
With
color.ui=alwaysorcolor.diff=alwaysin a repository's or a person's git config, everygit diffthe mod runs answers with ANSI escapes. The header and the per-file counts stay right (they come from--shortstatand--numstat, which git never colors), but no line matches the hunk header pattern any more, so every file's body is empty and the pane showsNo diff contentunder each changed file.--no-colornow rides the shared diff arguments (DIFF_LEADING_ARGS), which everygit diffchild of the mod spreads (the stats pass, the numstat listing, a file's hunks), so they all answer plain text whatever either setting says. The argv's doc says what the flag pins. The new test intests/git/fetch-diff.test.tsscripts a colored answer for a body fetch without the flag and a plain one with it, and expects the file's hunk.Checked:
color.ui=always, then withcolor.diff=always,diff.colorMoved=zebraand a customcolor.diff.meta: before,/difffromclaude --plugin-dir mods/diffshows2 files changed +2 -1, the two rows with their counts, andNo diff contentunder each; after, each file's hunks. Without either setting the pane reads the same before and after.tsc -p mods/tsconfig.json,claude plugin validate mods/diff,git diff --check, andclaude plugin teston all four mods (207 tests) under 2.1.277.Patch by @7487, from #91870.