From e12a7ef5972423c822834f9c514a54e32ea99e65 Mon Sep 17 00:00:00 2001 From: Johannes Schindelin Date: Fri, 27 Apr 2018 22:48:21 +0200 Subject: rebase -i: Handle "combination of commits" with GETTEXT_POISON We previously relied on the localized versions of # This is a combination of commits (which we write into the commit messages during fixup/squash chains) to contain encoded in ASCII. This is not true in general, and certainly not true when compiled with GETTEXT_POISON=TryToKillMe, as demonstrated by the regression test we just introduced in t3418. So let's decouple keeping track of the count from the (localized) commit messages by introducing a new file called 'current-fixups' that keeps track of the current fixup/squash chain. This file contains a bit more than just the count (it contains a list of "fixup "/"squash " lines). This is done on purpose, as it will come in handy for a fix for the bug where `git rebase --skip` on a final fixup/squash will leave the commit message in limbo. Signed-off-by: Johannes Schindelin Signed-off-by: Junio C Hamano --- sequencer.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'sequencer.h') diff --git a/sequencer.h b/sequencer.h index e45b178dfc..1898158c52 100644 --- a/sequencer.h +++ b/sequencer.h @@ -44,10 +44,14 @@ struct replay_opts { char **xopts; size_t xopts_nr, xopts_alloc; + /* Used by fixup/squash */ + struct strbuf current_fixups; + int current_fixup_count; + /* Only used by REPLAY_NONE */ struct rev_info *revs; }; -#define REPLAY_OPTS_INIT { -1 } +#define REPLAY_OPTS_INIT { .action = -1, .current_fixups = STRBUF_INIT } /* Call this to setup defaults before parsing command line options */ void sequencer_init_config(struct replay_opts *opts); -- cgit v1.2.3