git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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")
Previous: erik@cervined.inNext: Erik Cervin Edin
Message 9 of 13 in “commit: allow -m/-F with --fixup=amend: or reword:”
  1. 0/1 commit: allow -m/-F with --fixup=amend: or reword:erik@cervined.in, May 18, 2026
  2. 1/1 commit: allow -m/-F with --fixup=amend: or reword:erik@cervined.in, May 18, 2026
  3. Junio C HamanoMay 18, 2026
  4. Phillip WoodMay 18, 2026
  5. Erik Cervin EdinMay 24, 2026
  6. 0/2 commit: allow -m/-F/-c/-C for all --fixup variationserik@cervined.in, May 26, 2026
  7. 1/2 commit: allow -m/-F for all kinds of --fixuperik@cervined.in, May 26, 2026
  8. 2/2 commit: allow -c/-C for all kinds of --fixuperik@cervined.in, May 26, 2026
  9. Junio C HamanoAug 26, 2026
  10. Erik Cervin EdinSep 4, 2026
  11. 0/2 commit: allow -m/-F/-c/-C for all --fixup variationserik@cervined.in, Sep 22, 2026
  12. 1/2 commit: allow -m/-F for all kinds of --fixuperik@cervined.in, Sep 22, 2026
  13. 2/2 commit: allow -c/-C for all kinds of --fixuperik@cervined.in, Sep 22, 2026

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.