From: Johannes Schindelin Date: Thu, 3 May 2018 23:01:17 +0000 (+0200) Subject: sequencer: learn about the special "fake root commit" handling X-Git-Tag: v2.18.0~10^2~3 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/d87d48b2e033e8a8d39afbe7cb5eea331bbe47a6?hp=d87d48b2e033e8a8d39afbe7cb5eea331bbe47a6 sequencer: learn about the special "fake root commit" handling When an interactive rebase wants to recreate a root commit, it - first creates a new, empty root commit, - checks it out, - converts the next `pick` command so that it amends the empty root commit Introduce support in the sequencer to handle such an empty root commit, by looking for the file /rebase-merge/squash-onto; if it exists and contains a commit name, the sequencer will compare the HEAD to said root commit, and if identical, a new root commit will be created. While converting scripted code into proper, portable C, we also do away with the old "amend with an empty commit message, then cherry-pick without committing, then amend again" dance and replace it with code that uses the internal API properly to do exactly what we want: create a new root commit. To keep the implementation simple, we always spawn `git commit` to create new root commits. Signed-off-by: Johannes Schindelin Signed-off-by: Junio C Hamano ---