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

Re: FYI: git-am allows creation of empty commits.

From
Eric W. Biederman <ebiederm@xmission.com>
Date
Feb 24, 2006, 11:24 UTC
Message-ID
<m18xs1dmp3.fsf@ebiederm.dsl.xmission.com>
In-Reply-To
<7v1wxtgv02.fsf@assigned-by-dhcp.cox.net>
Junio C Hamano <junkio@cox.net> writes:
Show 8 quoted lines
> ebiederm@xmission.com (Eric W. Biederman) writes:
>
>> 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.
>
> Certainly a safty measure is missing here.  Thanks for
> noticing.  How about something like this?

Just tested it the patch works, at least in my simple contrived example :)

Is this something that we always want to test for in the porcelain or do we want to move a check into git-commit-tree?

For getting a reasonable error message where you have the test seems to be the only sane place, but having the check deeper down would be more likely to catch this kind of thing.

Eric
Previous: Junio C HamanoNext: Junio C Hamano
Message 3 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.