From 3f6c259711252b57646f447de85e44c5239ebd0d Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Wed, 30 Sep 2026 18:18:47 -0300 Subject: A diff look names a file as the repository does: git's side prefix dropped by git's rules, a plain diff's names as written In a git section (one with a `diff --git` line) the one-letter side prefix git writes, `a/`/`b/` or with diff.mnemonicPrefix `c/`, `i/`, `w/`, `o/`, is dropped from its paths only when both paths of that line carry one, different ones: `--no-prefix` writes none, so its `a/x a/x` is a real directory `a` and is kept. A plain `diff -u` never strips: its names are used as written, past the timestamp. `/dev/null` stays itself. The walker does this once (diff.Walk.side, diff.gitHeader), so the path a look resolves, and the one a miss says, are the repository's name: `Look: src/x.zig: no such file here`, `Look: lib/old.zig: deleted by this diff`. The look no longer tries a stripped name beside the written one. Co-Authored-By: Claude Opus 5.5 --- src/CHANGELOG.md | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/CHANGELOG.md') diff --git a/src/CHANGELOG.md b/src/CHANGELOG.md index 881df10c..69b737ca 100644 --- a/src/CHANGELOG.md +++ b/src/CHANGELOG.md @@ -1,5 +1,13 @@ # Changelog +## Unreleased + +- A look on a diff names a file as the repository does: git's `a/`/`b/` + (or mnemonic `c/`, `i/`, `w/`) is dropped only where both paths of the + `diff --git` line carry one, a `--no-prefix` diff's real `a/` is kept, a + plain `diff -u`'s names are as written, and a missing file is said by + that name (`Look: src/x.zig: no such file here`). + ## 0.0.10 - A 9P write never moves dot's end: scrolling written text into view moves -- cgit v1.3