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

Re: git format-patch on empty commit

From
Jeff King <peff@peff.net>
Date
Jan 11, 2016, 21:09 UTC
Message-ID
<20160111210915.GA21173@sigill.intra.peff.net>
In-Reply-To
<xmqqegdnx1xx.fsf@gitster.mtv.corp.google.com>
On Mon, Jan 11, 2016 at 01:04:42PM -0800, Junio C Hamano wrote:
Show 10 quoted lines
> So I think skipping no-op commit from the output was done pretty
> much deliberately and it is definitely not a bug.  I however do not
> think it is incorrect to say that it is a lack of feature that
> nobody so far found necessary or beneficial.
> 
> I would not refuse to consider adding a new option to "format-patch"
> to emit such a no-op message, and add a "having no patch is OK, just
> record a no-op commit" option to "am", though.  But I do not see a
> clear benefit from such change--it sounds more like a set of
> "because we could" not "because we need to" changes to me.

I think we are more or less on the same page. To me it is less "because we could" but that some people seem to find empty commits useful in their workflow (which is why we have "commit --allow-empty"), and if you use such a workflow, it is probably reasonable for "format-patch | am" or "rebase" to be trusted to preserve the history (at least with an option).

I do not use such workflows myself[1], so I will leave open the question of whether they have a benefit. :)

-Peff
[1] Though I will confess to finding "commit --allow-empty" quite useful
    when debugging.
Previous: Junio C HamanoNext: pedro rijo
Message 4 of 5 in “git format-patch on empty commit”
  1. pedro rijoJan 11, 2016
  2. Jeff KingJan 11, 2016
  3. Junio C HamanoJan 11, 2016
  4. Jeff KingJan 11, 2016
  5. pedro rijoJan 11, 2016

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.