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

Re: Cherry-picking commits with empty messages

From
Chris Webb <chris@arachsys.com>
Date
Aug 2, 2012, 08:55 UTC
Message-ID
<20120802085554.GI19416@arachsys.com>
In-Reply-To
<7vd33afqjh.fsf@alter.siamese.dyndns.org>
Junio C Hamano <gitster@pobox.com> writes:
> My recommendation, backed by the above line of thought, is to add
> support for the "--allow-empty-message" option to both "rebase [-i]"
> and "cherry-pick", defaulting to false.

Thanks for the very detailed analysis and advice Junio. I like your suggested --allow-empty-message option for cherry-pick because it's consistent with the same option in standard commit, and doesn't change the behaviour for existing users who might rely on cherry-pick catching blank messages.

With rebase -i, the fix might be slightly more involved than just passing through --allow-empty-message (if given) to cherry-pick, especially given that sometimes we git cherry-pick -n && git commit --allow-empty-message, and at other times we do standard git cherry-pick which refuses to pick a commit without a message.

Given a history with empty commits, as a general principle it feels like it should be possible to edit or reword those commits to make them non-empty without giving --allow-empty-message, but that to generate new history containing empty messages, --allow-empty-message should be required, whether to commit [--amend] during rebase, or to the rebase -i command itself.

Cheers,
Chris.
Previous: Angus HammondNext: Chris Webb
Message 6 of 11 in “Cherry-picking commits with empty messages”
  1. Chris WebbAug 1, 2012
  2. Junio C HamanoAug 1, 2012
  3. Angus HammondAug 1, 2012
  4. Junio C HamanoAug 1, 2012
  5. Angus HammondAug 2, 2012
  6. Chris WebbAug 2, 2012
  7. cherry-pick: add --allow-empty-message optionChris Webb, Aug 2, 2012
  8. Neil HormanAug 6, 2012
  9. Chris WebbAug 6, 2012
  10. Neil HormanAug 6, 2012
  11. Neil HormanAug 3, 2012

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.