]> git.ipfire.org Git - thirdparty/git.git/commit - sequencer.c
sequencer: allow introducing new root commits
authorJohannes Schindelin <johannes.schindelin@gmx.de>
Thu, 3 May 2018 23:01:23 +0000 (01:01 +0200)
committerJunio C Hamano <gitster@pobox.com>
Sun, 6 May 2018 04:21:58 +0000 (13:21 +0900)
commitebddf393964120628f60f6f5e435cde87cc209c6
tree30f61534d92bd5915894064bf083097ee01cfc70
parent21d0764c823bdca78b99dae562ca9e5c2a121738
sequencer: allow introducing new root commits

In the context of the new --rebase-merges mode, which was designed
specifically to allow for changing the existing branch topology
liberally, a user may want to extract commits into a completely fresh
branch that starts with a newly-created root commit.

This is now possible by inserting the command `reset [new root]` before
`pick`ing the commit that wants to become a root commit. Example:

reset [new root]
pick 012345 a commit that is about to become a root commit
pick 234567 this commit will have the previous one as parent

This does not conflict with other uses of the `reset` command because
`[new root]` is not (part of) a valid ref name: both the opening bracket
as well as the space are illegal in ref names.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
sequencer.c
t/t3430-rebase-merges.sh