Skip to main content

Scenario: feature-branch-from-main

The monorepo's feature branch has a commit that its main lacks. Upstream protects its main, say, so changes only go in through a PR from another branch.

The splice didn't change on feature, but feature has b, which upstream's main lacks. That's what counts, as for a PR: push creates feature upstream with it, ready for one (#150).

Output​

setup.bash builds this state:

$ build_scenario scenario_feature_branch_from_main

feature came about as in the feature branches guide. It started on main, with no feature branch upstream:

The monorepo and the splice upstream each have only a main branch

It was created at main:

The monorepo's new feature branch starts at main, while the splice upstream still has only main

Then it got b:

The monorepo's main branch at a and feature branch at b, and the upstream's main at k with b prime ready for a feature branch

$ git splice status
On branch feature

new, ahead 1 vendor/a push creates the branch
$ git splice log
=== vendor/a (upstream has no 'feature' branch -- compared with 'main')
< e859a6b local change (Test <test@example.com>)
$ git splice diff --stat
=== vendor/a
file.txt | 1 +
1 file changed, 1 insertion(+)
$ git splice push vendor/a
?? vendor/a: upstream has no 'feature' branch yet -- this push creates it
ok vendor/a: pushed e859a6b to feature

The monorepo&#39;s main branch at a and feature branch at b, and the upstream&#39;s main at k and new feature branch at b prime

$ git splice status
On branch feature

up to date vendor/a