Skip to content

fix: select diffs from the merge-base; the push hook keeps the exact range (#112) - #152

Merged
inth3shadows merged 2 commits into
mainfrom
fix/112-merge-base-diff
Oct 30, 2026
Merged

inth3shadows merged 2 commits into
mainfrom
fix/112-merge-base-diff

Conversation

@inth3shadows

Copy link
Copy Markdown
Owner

Fixes #112.

  • select --base main --head HEAD now diffs from merge-base(base, head), so changes that landed on main since the branch forked are no longer seeded as the branch's own. A docs-only branch behind a main that had added a migration used to list every journey. The result carries diff_base when it differs from base.
  • The pre-push hook keeps the exact range (exact_range=True, --exact-range in its full: command). A push moves the remote from its old tip to the new one, and after a rebase or rewind the fork point would hide what the push removes.
  • Head behind base, and no common ancestor (git merge-base exit 1), fall back to the tree diff with a warning. Any other merge-base failure raises.

Reviewed by /code-review and a code-reviewer agent. Both under-selection findings (a rewind or force-push, and head behind base) are fixed in e8337fb; the rest are filed as #151.

`base..head` compared two trees, so on a branch behind main the changes
that landed on main since the fork were seeded as the branch's own: a
docs-only branch listed every journey because main had added a
migration (and since #117 any unmodeled file on main does that).

select now diffs merge-base(base, head)..head. When base is an ancestor
of head (HEAD~1, every push) that is base itself, so nothing changes.
With no common ancestor it falls back to the tree diff and warns. The
result carries `diff_base` when it differs from base, and the text says
so. Docs, the MCP description and the verify skill follow.
…empty diff (#112 review)

- The pre-push hook moves the remote from its old tip to the new one;
  after a rebase or rewind the merge-base hid what the push removes (a
  dropped migration read as a confident NONE). hook.run now calls
  select(exact_range=True), and its `full:` command carries
  --exact-range (new select flag).
- head an ancestor of base made the merge-base head itself, an empty
  diff by construction: fall back to the tree diff with a warning.
- Only `git merge-base` exit 1 means "no common ancestor"; anything else
  raises instead of being mislabelled as unrelated histories.
- _same_rev replaced by ledger.resolve_commit.
@inth3shadows
inth3shadows merged commit e1647f4 into main Oct 30, 2026
5 checks passed
@inth3shadows
inth3shadows deleted the fix/112-merge-base-diff branch October 30, 2026 15:06
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.

select diffs base..head (two-dot), not merge-base...head

1 participant