Scenario: squash-merged-pull
A pull on a feature branch, squash-merged into main.
- Upstream:
seedonmain, and someone else's commit onfeature. - Monorepo (
vendor/a/): cloned atseed. Onfeature,git splice pullbrought in the upstream commit.featurewas squash-merged intomainand deleted, then a local commit followed onmain.
A squash merge keeps the content and drops the history. With git subtree,
that lost the sync point. Here the squash merge itself
changed .splice, so it is the new boundary, and the rebuild starts at the
pulled upstream commit: a push sends only the local commit.
The drawing names the monorepo's commits a (add vendor/a), s (the
squash merge) and c (local change), and the upstream's k (seed, T)
and f (upstream feature work).
Output
setup.bash builds this state:
$ build_scenario scenario_squash_merged_pull
The drawing shows what Git and git-splice say about it, with each
commit named by its place in the history
(check_drawing):
$ check_drawing "$TESTDIR/squash-merged-pull.drawio.svg" a=HEAD~2 s=HEAD~1 c=HEAD k=refs/splices/upstream/main f=refs/splices/upstream/feature
ok squash-merged-pull.drawio.svg: 6 commits, 9 arrows, 5 boxes, 0 frames
$ git log --format=%s
local change
feature (squash-merged)
add vendor/a
initial commit
$ git splice status
On branch main
ahead 2 vendor/a
$ git splice log
=== vendor/a (main)
< 5c5de89 local change (Test <test@example.com>)
< 223f9b4 upstream feature work (Test <test@example.com>)
$ git splice push vendor/a
ok vendor/a: pushed 5c5de89 to main
$ git -C "$UPSTREAM" log --format=%s main
local change
upstream feature work
seed