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

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

From
EWEric Wong <normalperson@yhbt.net>
Date
Feb 24, 2006, 13:19 UTC
Message-ID
<20060224131922.GA19401@localdomain>
In-Reply-To
<7vy8019d44.fsf@assigned-by-dhcp.cox.net>
Junio C Hamano <junkio@cox.net> wrote:
Show 12 quoted lines
> ebiederm@xmission.com (Eric W. Biederman) writes:
> 
> > 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.
> 
> I think 99.9% of the time it is a mistake if a single-parented
> commit has the same tree as its parent commit has, so having a
> check in commit-tree may not be a bad idea.

This would break importers, more than 0.1% I think... Arch definitely allows empty commits for getting log messages in. SVN forbids them from their POV, but they also have things that we can't see when we import (properties like: mime, externals, eol-style) causing us to write the same tree twice. Not sure about CVS...

Maybe a flag such as --force could be added.
-- 
Eric Wong
Previous: Eric W. BiedermanNext: Junio C Hamano
Message 7 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.