Skip to content

ocr review --from/--to silently reports "No files changed" when a global diff.external (e.g. difftastic) is configured #82

@Christophe1997

Description

@Christophe1997

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:

  1. 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 → disables diff.external and per-attribute external drivers
  • --no-textconv → disables textconv filters
  • --src-prefix=a/ --dst-prefix=b/ → forces standard prefixes regardless of diff.noprefix / diff.mnemonicPrefix / custom srcPrefix/dstPrefix

Steps to Reproduce

  1. Configure a custom external diff driver globally (difftastic here)
    git config --global diff.external difft
  2. 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No fields configured for Bug.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions