Skip to main content

Scenario: original-without-the-patch

The same splice, right before it takes a release of the original: the monorepo pulled the fork's patch, and the original moved on without it. The original's main lacks the synced commit, as a rebased patch branch does, but nothing was rewritten: the original never had the patch.

git splice pull --upstream origin merges r in. Git's merge base of R, f, and r is k, so the fork's patch is a change on the monorepo's side only, and stays. A rebased branch would merge from its fork point instead, where the fetched branch was before, but the original's fetched main never pointed at f: its reflog has only k and r. What the fork has doesn't matter for a pull from the original.

Output​

setup.bash builds this state:

$ build_scenario scenario_original_without_the_patch https://git.example.com/lib.git https://git.example.com/company/lib.git

The monorepo's a, c and x, H and B; the lane vendor/a/ split in two: origin with r on top of k, its main; fork with f on top of k, which is T, R, U(H) and U(B)

The original's fetched main was k, then r:

$ git log -g --format=%s refs/splices/lib/heads/main
original release
seed
$ git splice pull --upstream origin vendor/a
ok vendor/a fetched from origin
ok vendor/a: pulled 3fd09f0

The folder has both the patch and the release:

$ cat vendor/a/file.txt vendor/a/release.txt
seed
fork patch
original release