Re: [PATCH v2 2/2] commit: allow -c/-C for all kinds of --fixup
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Aug 26, 2026, 21:31 UTC
- Message-ID
- <xmqq1pbkefh0.fsf@gitster.g>
- In-Reply-To
- <b3fc743abf5d35fbb23c7483836de292ad5bffda.1779792311.git.erik@cervined.in>
erik@cervined.in writes:
Show 18 quoted lines
> From: Erik Cervin-Edin <erik@cervined.in> > > The previous commit allowed -m and -F for all --fixup variations. The > -c/-C flags were blocked by the same higher-layer incompatibility check > that previously caught -F, namely die_for_incompatible_opt4() grouping > them with --fixup. > > Drop --fixup from that check and route the resolved commit through > prepare_amend_commit() in the fixup path, mirroring the no-message-source > behaviour of --fixup=amend. With this in place, -m/-F/-c/-C all behave > consistently across the plain, amend, and reword --fixup forms. > > Signed-off-by: Erik Cervin-Edin <erik@cervined.in> > --- > Documentation/git-commit.adoc | 9 ++-- > builtin/commit.c | 13 +++-- > t/t7500-commit-template-squash-signoff.sh | 60 +++++++++++++++++++++-- > 3 files changed, 71 insertions(+), 11 deletions(-)
Sorry, but this topic has been hanging without getting any reviews on the list for quite a while.
Any takers?
One small thing I noticed appears here:
Show 9 quoted lines
> @@ -1341,7 +1346,7 @@ static int parse_and_validate_options(int argc, const char *argv[],
> die(_("options '%s' and '%s' cannot be used together"), "--squash", "--fixup");
> die_for_incompatible_opt3(!!use_message, "-C",
> !!edit_message, "-c",
> - !!fixup_message, "--fixup");
> + !!logfile, "-F");
> die_for_incompatible_opt4(have_option_m, "-m",
> !!edit_message, "-c",
> !!use_message, "-C",This blocks -C, -c, -F from being used together. But the next opt4() covers these combinations already:
die_for_incompatible_opt4(have_option_m, "-m", !!edit_message, "-c", !!use_message, "-C", !!logfile, "-F")