Skip to main content

Scenario: squash-merged-pull

A pull on a feature branch, squash-merged into main as s, then a local commit, c.

.splice records a commit, not a branch: s records f, though nobody merged the upstream's feature into its main.

A squash merge keeps the content and drops the history. With git subtree, that lost the sync point. Here s itself changed .splice, so it is B, and the rebuild starts at f.

Output​

setup.bash builds this state:

$ build_scenario scenario_squash_merged_pull

The monorepo's a, the squash merge s and c; the upstream's k on main and f on feature; R is c prime on top of f, and B is s

$ git log --format=%s
c: local change
s: feature (squash-merged)
add vendor/a
initial commit
$ git splice status
On branch main

ahead 2 vendor/a
$ git splice log
=== vendor/a (main)
< 2b23025 c: local change (Test <test@example.com>)
< 1ee7bf7 f: upstream feature work (Test <test@example.com>)
$ git splice push vendor/a
ok vendor/a: pushed 2b23025 to main
$ git -C "$UPSTREAM" log --format=%s main
c: local change
f: upstream feature work
seed