Skip to main content

Scenario: sync-model

The state the README and the sync model draw: both sides moved on since the clone, and nothing was pulled or pushed yet. The commits are named as in the drawing below.

after-pull continues with the pull.

Output​

setup.bash builds this state:

$ build_scenario scenario_sync_model

Monorepo commits a to d, upstream commits k to n, and the rebuilt commits b prime and d prime on top of k: U(H) = U(B) = k

The README draws the same state with Git's names for a three-way merge, for readers who don't know H, B, T and R yet. Each stands for a term the drawing check (check_drawing) knows; base is where ours and theirs meet:

$ check_drawing "$TESTDIR/before-pull-git-names.drawio.svg" \
> --alias HEAD=H --alias boundary=B --alias ours=R --alias theirs=T \
> --alias 'base=merge-base(R,T)'
ok before-pull-git-names.drawio.svg: 10 commits, 13 arrows, 5 boxes, 1 lanes

Monorepo commits a to d, with HEAD at d and boundary at a, the clone of k; library commits k to n, theirs at n; ours is d prime, the rebuilt b prime and d prime on top of k, which is U(boundary) and base

R and T have each moved on from k:

$ git splice log --graph lib
=== lib (main)
< d4da194 (R) d (Test <test@example.com>)
< 9ec734f b (Test <test@example.com>)
| > df79a48 (T) n (Test <test@example.com>)
| > d34c417 m (Test <test@example.com>)
| > 5ba0fc7 l (Test <test@example.com>)
|/
o ae8b31f k (Test <test@example.com>)