open-code-review
open-code-review copied to clipboard
ocr review --from/--to silently reports "No files changed" when a global diff.external (e.g. difftastic) is configured
OpenCodeReview Version
open-code-review v1.2.6 (48cc6a3) darwin/arm64 built at: 2026-06-09T02:00:04Z
Operating System
macOS (Apple Silicon)
Installation Method
npm (global)
LLM Provider
Anthropic (Claude)
Bug Description
Overview
I have a custom diff driver configured globally (diff.external in ~/.gitconfig), and run ocr in branch range mode. ocr review --from <a> --to <b> reports "No files changed" even though the two refs differ by many files. It seems:
- ocr does not insulate its git invocations from user diff config. All internal git diff / git show calls used for parsing should pass --no-ext-diff and --no-textconv (and ideally run with -c core.pager=cat)
Suggested fix
// internal/diff/git.go — isolate from user diff drivers
p.runGit(ctx, "diff", "--no-ext-diff", "--no-textconv", "--src-prefix=a/", "--dst-prefix=b/", "--no-color", "-U"+n, base, p.to, "--")
p.runGit(ctx, "show", "--no-ext-diff", "--no-textconv", "--src-prefix=a/", "--dst-prefix=b/", "--no-color", "-U"+n, p.commit)
--no-ext-diff→ disablesdiff.externaland per-attribute external drivers--no-textconv→ disables textconv filters--src-prefix=a/ --dst-prefix=b/→ forces standard prefixes regardless ofdiff.noprefix/diff.mnemonicPrefix/ customsrcPrefix/dstPrefix
Steps to Reproduce
- Configure a custom external diff driver globally (difftastic here)
git config --global diff.external difft - In any repo where branch B has changes vs A:
ocr review --from main --to feature-branch --preview # => "No files changed."
Expected Behavior
I expect it works well in branch range mode, and sanity check that the refs really differ
git diff --name-only main...feature-branch | wc -l
Logs / Error Output
Additional Context
No response
Hi @Christophe1997, thanks for the detailed report and the suggested fix!
This has been resolved in v1.2.7. Specifically:
- PR #86 added
--no-ext-diff --no-textconvto all internalgit diff/git showcalls, fixing the core issue with external diff drivers like difftastic. - A follow-up commit further added
--src-prefix=a/ --dst-prefix=b/to guard againstdiff.noprefix/diff.mnemonicPrefixbreaking the parser as well.
You can upgrade via:
npm update -g @anthropic-ai/open-code-review
Thanks again for the feedback — really appreciate it!