Skip to content

feat(ancestry): find merge bases, merging criss-crossed ones - #90

Open
PiquelChips wants to merge 1 commit into
mainfrom
feat/land-ancestry
Open

PiquelChips wants to merge 1 commit into
mainfrom
feat/land-ancestry

Conversation

@PiquelChips

Copy link
Copy Markdown
Member

A merge needs a base: the snapshot both sides started from. For a change's heads, that's the newest revision they all evolve from; for two targets that landed each other, the newest acceptance both histories share.

Ancestry walks such a history once, from its tips, and finds their best common ancestors. The newest shared ancestor wins, however far it is. Histories that merged each other criss-cross and have several; as git's recursive strategy does, they're merged into one first, each from their own merge base.

Merging bases uses Store::merge_bases. Where the bases conflict, it leaves an entry no object has, and never reads under it, since the bases may have had a directory there. A merge from that base then conflicts at, and under, every such path unless both sides agree, rather than take what one side removed for what the other added.

Note

Written by Claude Opus 5.5 in Claude Code (via T3 Code)

@coderabbitai

coderabbitai Bot commented Nov 22, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 34 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 17d9fc24-c232-4b72-8b2a-ed58f35a80cc
Commits

Reviewing files that changed from the base of the PR and between 85101c0 and 753df71.

Files selected for processing: 3

  • apps/origin-src/src/ancestry.rs
  • apps/origin-src/src/lib.rs
  • apps/origin-src/src/tree.rs
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@PiquelChips
PiquelChips added this pull request to stack #165 November 22, 2026 14:59
Base automatically changed from feat/land-merge to main November 22, 2026 19:20
A merge needs a base: the snapshot both sides started from. For a
change's heads, that's the newest revision they all evolve from; for two
targets that landed each other, the newest acceptance both histories
share. Either history is a graph of immutable records, each with its
parents and a snapshot.

`Ancestry` walks such a history once, from its tips, and finds their best
common ancestors: those every tip descends from, but no other shared
ancestor descends from. The newest shared ancestor wins, however far it
is. Histories that merged each other criss-cross and have several; as
git's recursive strategy does, they're merged into one first, each from
their own merge base.

Merging bases uses `Store::merge_bases`, which leaves an entry no object
has where they conflict, and never reads under it: the bases may have
had a directory there. A merge from that base then conflicts at, and
under, every such path unless both sides agree, rather than take what
one side removed for what the other added.
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.

1 participant