Skip to main content

Scenario: diverged-then-pulled

Both sides changed different files, then upstream's change was pulled in. The local change is still waiting to be pushed.

  • Monorepo (vendor/a/): cloned at seed, a local commit adding local.txt, then git splice pull, which merged cleanly.
  • Upstream: seed, then a commit adding upstream.txt. It has never seen local.txt.

The pull's commit is the newest that changed .splice, but its folder differs from the synced commit: it contains local.txt. So the boundary stays the clone, and the push rebuilds the pull as a merge of the local commit with upstream's, and the local commit keeps its own identity upstream.

Output​

setup.bash builds this state:

$ build_scenario scenario_diverged_then_pulled
$ git splice status
On branch main

ahead 2 vendor/a
$ git splice log
=== vendor/a (main)
< 1c41ddd splice: pull vendor/a from main at 9887ec6 (Test <test@example.com>)
< c013d32 local change (Test <test@example.com>)
$ git splice push vendor/a
ok vendor/a: pushed 1c41ddd to main
$ git -C "$UPSTREAM" log --graph --format=%s main
* splice: pull vendor/a from main at 9887ec6
|\
| * upstream change
* | local change
|/
* seed