Make interdiff rebase-aware by recording a base per revision #3
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Spec: docs/superpowers/specs/2026-08-09-patch-revision-refs-design.md
interdiff (patch.rs:501-525) is a flat tree-to-tree diff between two revision trees with no base awareness. When a rebase separates the revisions, the result includes every upstream commit rebased over, burying the author's actual response to review.
Single-revision diff does not have this problem - resolve_base_tree (patch.rs:454-466) three-dots against the current base branch. Only the interdiff path needs fixing.
Fix:
Revisions with no stored base fall back to recomputing against the current base branch, which is today's behaviour.
Migrated from git-collab issue
8db8d346fa3e19cdd74593d1fee3ce6e0567299d.Original author: a73x dev@a73x.sh.
Close reason: merged in patch
f02f05c3Correction to this issue's scoping premise, found while reviewing patch
659f0350.This issue says 'Single-revision diff does not have this problem - resolve_base_tree (patch.rs:454-466) three-dots against the current base branch. Only the interdiff path needs fixing.' That is not right. Three-dotting against the current base branch fails in the same way once the base branch has absorbed the patch: merge_base collapses to the revision commit itself and 'patch diff --revision N' renders empty for every merged patch. Verified by demonstration; details and repro in issue
57575b50.The rest of this issue stands. The per-revision base it asks for has now landed in patch
659f0350(Revision.base, computed as merge_base at record time), so the enabling data is in place and the remaining work here is the interdiff algorithm itself.Concrete evidence, generated during review of
659f0350rather than argued from the code.Setup: a patch with one real edit to feature.txt. Upstream advances three commits touching other files. The author rebases and records revision 2.
'patch diff --between 1 2' emitted FOUR files: one real change, three pure upstream churn. 75% noise from a trivially busy upstream. On a real main the author's actual response to review would be buried entirely.
Also worth noting the reviewer could not tell this had happened from any output - nothing displays a revision's base, so a polluted interdiff is indistinguishable from a clean one. Filed separately as a disclosure issue; it is worth fixing even before this one lands.