Skip to content

Range and commit modes filter changed files with the working tree's ignore rules #1487

Open

Description

@Hiro-Mati

In --from/--to and --commit modes, ignore rules are read from the current checkout, not from the reviewed ref (internal/diff/git.go, partitionDiffs). A local, uncommitted .gitignore entry (or one that exists on the checked-out branch but not on the reviewed one) can drop files from a range review.

Repro: feature adds gen.go and has no .gitignore; with an uncommitted local .gitignore containing gen.go, ocr review --from base --to feature reviews nothing.

Should range/commit modes read .gitignore files from the reviewed ref (e.g. git show REF:.gitignore / check-ignore against a temporary index), or is the working-tree behavior intended?

Environment: v1.12.7.

AI disclosure: found with Claude Code (model: Claude Opus 5) during an audit where each finding was reproduced by a failing test.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions