summaryrefslogtreecommitdiff
path: root/sequencer.h
diff options
context:
space:
mode:
authorJohannes Schindelin <johannes.schindelin@gmx.de>2018-05-03 23:01:17 (GMT)
committerJunio C Hamano <gitster@pobox.com>2018-05-06 04:21:58 (GMT)
commitd87d48b2e033e8a8d39afbe7cb5eea331bbe47a6 (patch)
tree3b774e0f02ae33eec7a874f73d863eb14434d958 /sequencer.h
parentba97aea1659e249a3a58ecc5f583ee2056a90ad8 (diff)
downloadgit-d87d48b2e033e8a8d39afbe7cb5eea331bbe47a6.zip
git-d87d48b2e033e8a8d39afbe7cb5eea331bbe47a6.tar.gz
git-d87d48b2e033e8a8d39afbe7cb5eea331bbe47a6.tar.bz2
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 <GIT_DIR>/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 <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'sequencer.h')
-rw-r--r--sequencer.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/sequencer.h b/sequencer.h
index d9570d9..4b27178 100644
--- a/sequencer.h
+++ b/sequencer.h
@@ -44,6 +44,10 @@ struct replay_opts {
char **xopts;
size_t xopts_nr, xopts_alloc;
+ /* placeholder commit for -i --root */
+ struct object_id squash_onto;
+ int have_squash_onto;
+
/* Only used by REPLAY_NONE */
struct rev_info *revs;
};