Repository navigation
Conversation
`git diff` follows the user's git config. An external diff tool (`diff.external`, for example difftastic) replaces the unified diff, forced color puts escape codes before `diff --git`, and `diff.noprefix` or `diff.mnemonicPrefix` drop or change the `a/` and `b/` prefixes. With any of them, a local `ecr review` parsed no files and reported "No reviewable changes". Every `git diff` that LocalGitSource parses now passes `--no-ext-diff --no-color --src-prefix=a/ --dst-prefix=b/`. CI is unaffected: it reads the PR diff from GitHub's API.
🤖 AI code reviewDecision: Ready for human review Overall PR risk: Low. This change modifies all four local diff calls to override user configurations with fixed git flags, ensuring unified diff output. The blast radius is limited to local-mode reviews; GitHub-based CI and PR sources are unaffected. Most plausible breakage: older git versions rejecting new flags, or changed behavior where submodule edits no longer appear when the pointer did not move.
No findings. This review is advisory — it never blocks a merge and never auto-approves. |
tsapeta
marked this pull request as ready for review
October 20, 2026 22:36
…den the tests A textconv driver showed converted text instead of the real file, or hid a change when both sides converted alike, and `diff.renames=copies` turned a copied file into a hunk-less entry whose contents went unreviewed. `--no-textconv` and `--find-renames` join the shared flags. The tests now fail when any one flag is removed: the fixture has a `b/` path that `diff.noprefix` breaks, and new cases cover `diff.mnemonicPrefix`, textconv and copy detection. Fixture commits ignore global signing and hooks, and LLP 0008's line references are current again.
…late the local-git tests - Local diffs also pass --submodule=short and --ignore-submodules=dirty, so diff.submodule=log|diff, diff.ignoreSubmodules=all and ignore = all in .gitmodules can't hide or rewrite a submodule pointer change, and edits inside a submodule whose pointer didn't move aren't sent for review. - The tests remove every GIT_* variable and point HOME and XDG_CONFIG_HOME at an empty directory, so a hook's GIT_DIR/GIT_INDEX_FILE or the user's global git files can't touch another repo or fail the fixtures. - New tests: deletions under diff.noprefix and diff.mnemonicPrefix (the only case --src-prefix protects), and the submodule settings above. - LLP 0004 and 0008 line references updated.
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.
Why
A local
ecr review(and so the/expo-reviewskill in expo/expo) reported "No reviewable changes" for me, because my git config hasdiff.external=difft.LocalGitSourceruns plaingit diff, which follows the user's config, so the parser got difftastic's output instead of a unified diff. Forced color (color.diff=always) anddiff.noprefixordiff.mnemonicPrefixbreak it the same way: escape codes land beforediff --git, or thea/andb/prefixes thatparseUnifiedDiffmatches are missing or turn intoc/andw/.How
Every
git diffthatLocalGitSourceparses (staged,base...head, working tree, and the--no-indexdiffs for untracked files) now passes--no-ext-diff --no-color --src-prefix=a/ --dst-prefix=b/, which gives the plain unified diff whatever the config says. CI isn't affected, sinceecr cireads the PR diff from GitHub's API. LLP 0008's "Local Git Source" section now records this.Test Plan
The new
src/__tests__/local-git.test.tsbuilds a repo whose local config setsdiff.external,color.diff=alwaysanddiff.noprefix, and checks that the working-tree (with an untracked file),base...headand staged diffs all parse. All three fail without the fix.bun test(798 pass),bun run typecheck,bun run lint,bun run fmt:checkandbun run llp:checkpass.Follow-up commit (1c58670)
From a multi-model review of this PR:
--no-textconvand--find-renamesjoin the shared flags. A textconv driver showed converted text instead of the real file, or hid a change entirely when both sides converted alike.diff.renames=copiesturned a copied file into acopy from/copy toentry with no hunk, so its contents went unreviewed.b/inner.txtpath thatdiff.noprefixbreaks, and new cases coverdiff.mnemonicPrefix, textconv and copy detection.-c commit.gpgsign=falseand--no-verify, so a global signing setup or hooks path no longer fails all of them.Not changed: repository attributes (
binary,-diff) still mark a file binary, and noise filtering drops it. The checkout is trusted in local mode (LLP 0001).bun test(801 pass),typecheck,lint,fmt:checkandllp:checkpass.Follow-up commit (eb72d19)
From a second multi-model review:
--submodule=shortand--ignore-submodules=dirtyjoin the shared flags.diff.submodule=logprinted commit subjects that parsed as nothing,diff.submodule=diffshowed the submodule's own files instead of the pointer change, anddiff.ignoreSubmodules=allorignore = allin.gitmodulesdropped the change entirely.dirty(not git's defaultnone) also keeps edits inside a submodule whose pointer didn't move out of the review.GIT_*variable, sobun testfrom a pre-commit hook can't write fixtures into the commit being made throughGIT_INDEX_FILE. They also pointHOMEandXDG_CONFIG_HOMEat an empty directory, so a global hooks path, signing, or a global ignore or attributes file can't fail them, on any git version.diff.noprefixanddiff.mnemonicPrefix, the only case where--src-prefixmatters, and the submodule settings above. Removing any one of the eight flags fails at least one test.Not changed: other test files (for example
init-scaffold) still use the caller'sGIT_DIRwhen run from a hook; a suite-widebunfig.tomlpreload would fix that separately.bun test(808 pass),typecheck,lint,fmt:checkandllp:checkpass.