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

FYI: git-am allows creation of empty commits.

From
Eric W. Biederman <ebiederm@xmission.com>
Date
Feb 23, 2006, 15:33 UTC
Message-ID
<m1slqahyxt.fsf@ebiederm.dsl.xmission.com>
Currently I am using: git version 1.2.2.g709a.
I have been rebasing and refactoring a number of patchsets using git.

Frequently because of prior edits I will git a patch that does not apply at all. So all I get is the creation of the .dotest directory. The automatic merge logic does not kick in, so I have to manually call patch -p1 and resolve the differences but hand. There everything is expected and fine. Although it might have been nice to have one of those failed merge indicators in the index.

After fixing it up and doing all of my edits I occasionally forget the git-update-index step, before calling git-am --resolved. This proceeds along it's merry way and creates an empty commit.

Is this the expected correct behavior or should git-am complain about a situation like that?

Eric
Next: Junio C Hamano
Message 1 of 8 in “FYI: git-am allows creation of empty commits.”
  1. Eric W. BiedermanFeb 23, 2006
  2. Junio C HamanoFeb 24, 2006
  3. Eric W. BiedermanFeb 24, 2006
  4. Junio C HamanoFeb 24, 2006
  5. commit-tree: disallow an empty single-parent commit.Junio C Hamano, Feb 24, 2006
  6. Eric W. BiedermanFeb 24, 2006
  7. Eric WongFeb 24, 2006
  8. Junio C HamanoFeb 25, 2006

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.