Rebase via monorepo
In the same state, feature is rebased onto main in the
monorepo, and the result replaces the PR:
- On
main:git splice pull. Done already: p brought in m. - On
feature:git rebase main. git splice push --force.
The PR ends up as "Update branch" with a rebase on GitHub would leave
it. --force overwrites whatever upstream's feature has, so it's for
a PR nobody else pushes to.
Output
rebase-setup.bash builds this state:
$ build_scenario scenario_feature_branch_behind_default_branch
The rebase copies b onto p as c:
$ git rebase -q main
$ git log --graph --format=%s
* b: feature change
* p: pull the dependency update
* a: clone vendor/a
* initial commit
$ git splice status
On branch feature
ahead 2, behind 1 vendor/a
A plain push refuses: upstream has a commit this branch lacks. That
it's b', the copy of b from before the rebase, is for you to know:
$ git splice push vendor/a
!! vendor/a: upstream has commits this branch lacks
!! Failed: vendor/a
[1]
$ git splice push --force vendor/a
ok vendor/a: pushed 125a49b to feature
$ git -C "$UPSTREAM" log --graph --format=%s feature
* b: feature change
* m: bump dep
* k: seed
$ git splice status
On branch feature
up to date vendor/a