gunk-dev/the-valley
the-valley:bd-276ba86bugclosed

Review of a version rebuilt after a restack conflict prints the whole range-diff instead of what changed since the approved version

State
done
Created
2026-11-12 by contributor
Changes
  • valley:the-valley/sopnvnoyqvpvzwzuykluzxszwpzzstmu

Body

When a ready change conflicts with a landing, its author rebases it and resolves the conflict. The new version's commit is not the approved one's by patch or message, so review calls it edited (`status/compare.go`) and shows three things: each file whose delta differs, the whole `git range-diff B₀..H₀ B₁..H₁`, and the new version's diff of those files.

The range-diff is most of the page and almost none of it answers the reviewer's question, which is what the author changed since the approved version. It shows every hunk whose context moved because main edited nearby lines. In a file main reformatted (a wide Markdown table), that is screens of wrapped rows. With `-v` each file also lists four blob IDs.

Measured on one such version: 11 files had a differing delta. In 9, the change's own added and removed lines were identical to the approved version's; only context differed. In one, two table rows differed because main had reworded them. One file was new to the change. The reviewer needed about 10 lines and got several hundred.

Fixed when, for an edited version whose approved version is known:
- each file whose delta differs is classed by comparing the two deltas' added and removed lines, ignoring context and position: same edits (main changed around them), edits differ, new to the change, or dropped from it;
- files with the same edits are one line each, or one count;
- only files whose edits differ, are new or are dropped show a diff, and that diff is between the approved version's edits and the shown version's, not a diff of diffs with context;
- a changed commit message shows as its own short diff;
- the full range-diff is still reachable by a key or flag, not printed by default;
- notes taken beside the shown lines still anchor to a file and line.

The same classification is what a carry mode could use to say an approval still covers a version whose edits are unchanged after a conflict in context only; that is a policy question and not part of this fix.

Comments

  1. contributor2026-11-13 00:13 UTC
    Design under review: instead of comparing added and removed lines (unsound: a line moved to another place compares equal), compute the tree the approved version becomes when carried mechanically onto the new base (`git merge-tree --write-tree --merge-base=B0 B1 H0`) and show `git diff <carried> <shown head>`. Files equal to the carry are one line each; the range-diff and blob lines move behind `-v`; a changed commit message prints as a line diff.
  2. contributor2026-11-13 00:16 UTC
    Critique of the carried-tree design, taken into the build brief:
    - a conflicted path is never counted as carried unchanged; for a conflict that is not a plain content conflict the page shows the approved version's diff and the shown version's, and says so when either is empty (approved deletion, main edits the file, shown version keeps main's file: both tree diffs are empty);
    - conflicts are read from `merge-tree -z` structured messages (several paths per conflict, several types per path, directory conflicts with no file entry), exit 1 told apart from failure;
    - the carry runs in a controlled git environment, since a `merge=union` attribute in a person's configuration resolves conflicts silently;
    - `clean`/`changed` keep their meaning, and the fields carry reads are unchanged;
    - when the carry cannot be computed, the page falls back to its earlier form.
  3. contributor2026-11-13 00:48 UTC
    Review of the build at 0b2f563 before marking it ready: read `status/carried.go` and the page builder in `status/compare.go`; the whole-tree `git diff <carried> H1` covers paths outside the files whose delta differs, and a conflicted path never enters the unchanged group. Reproduced by hand on the version that prompted this knot: the carry conflicts in two files; the new page holds three files and 42 changed lines (two conflict resolutions and one further edit), where the earlier page held a 187-line range-diff and a 4,299-line diff. The author's run built 19 checks; 18 of them ran before a last one-line fix, and the host worker builds the final head.
  4. contributor2026-11-13 02:02 UTC
    Change valley:the-valley/sopnvnoyqvpvzwzuykluzxszwpzzstmu landed: v1 as 89496f97a023676d97e74210bc5f391d4b7b6291.
    
    Every change the knot links has landed and it has no active children, so klaus set it closed.