Skip to content

fix: resolve patch navigation for explicit diffs#2472

Open
tomtomjhj wants to merge 2 commits into
tpope:masterfrom
tomtomjhj:diff-patch-nav
Open

fix: resolve patch navigation for explicit diffs#2472
tomtomjhj wants to merge 2 commits into
tpope:masterfrom
tomtomjhj:diff-patch-nav

Conversation

@tomtomjhj
Copy link
Copy Markdown
Contributor

Problem:
Opening a patch entry from :Git diff A B -- path treated a/ and b/ as the default HEAD/index sides because the pager buffer did not carry its parsed diff endpoints into the cfile lookup.

Solution:
Extract the diff endpoint parser used by :Git difftool and reuse it when translating patch header paths. This maps a/ and b/ to the actual revisions from the saved :Git diff argv while preserving the existing difftool context ordering.

Fixes #2269

tomtomjhj and others added 2 commits April 22, 2026 20:49
Problem:
Opening a patch entry from `:Git diff A B -- path` treated `a/`
and `b/` as the default HEAD/index sides because the pager buffer did
not carry its parsed diff endpoints into the cfile lookup.

Solution:
Extract the diff endpoint parser used by `:Git difftool` and reuse it
when translating patch header paths. This maps `a/` and `b/` to the
actual revisions from the saved `:Git diff` argv while preserving the
existing difftool context ordering.

Co-authored-by: OpenAI Codex <codex@openai.com>
Co-authored-by: OpenAI Codex <codex@openai.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Diffing a file between two commits not work as expected.

1 participant