]> git.ipfire.org Git - thirdparty/git.git/commit - sequencer.c
rebase --rebase-merges: avoid "empty merges"
authorJohannes Schindelin <johannes.schindelin@gmx.de>
Wed, 25 Apr 2018 12:29:31 +0000 (14:29 +0200)
committerJunio C Hamano <gitster@pobox.com>
Thu, 26 Apr 2018 03:28:43 +0000 (12:28 +0900)
commit7ccdf65b63f2f4a5e751d70b9788af3c9e16b6ab
tree4b13b7802f35f2f7d83cebf95f4ed88635eba6d3
parent537e7d61359233e95d2ca6ef6b9059afca8daa81
rebase --rebase-merges: avoid "empty merges"

The `git merge` command does not allow merging commits that are already
reachable from HEAD: `git merge HEAD^`, for example, will report that we
are already up to date and not change a thing.

In an interactive rebase, such a merge could occur previously, e.g. when
competing (or slightly modified) versions of a patch series were applied
upstream, and the user had to `git rebase --skip` all of the local
commits, and the topic branch becomes "empty" as a consequence.

Let's teach the todo command `merge` to behave the same as `git merge`.

Seeing as it requires some low-level trickery to create such merges with
Git's commands in the first place, we do not even have to bother to
introduce an option to force `merge` to create such merge commits.

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