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

Re: commit-id fails after cg-init

From
David A. Wheeler <dwheeler@dwheeler.com>
Date
May 4, 2005, 15:14 UTC
Message-ID
<4278E6D4.6060807@dwheeler.com>
In-Reply-To
<20050503211301.GA15995@pasky.ji.cz>
Joel Becker said:
> Well, cg-init in this case creates no objects.  I'd say,
>instead, it should create an empty tree object (representing a project
>with no files) and commit that.  That would be your initial commit, and
>would put something valid in heads/master.

That would actually make sense; commits would go all the way back to the "empty tree" as the ultimate initial tree.

There's an interesting side-effect of this; I _think_ it's fine but it might be worth thinking through. If all new projects start with an empty tree, that creates a "common root" that all projects can appeal to. That means that in theory a merge between any two project root trees can eventually find a common ancestor: the empty tree. I _think_ that's okay... is it?

That also means that empty directories will end up with the "empty tree" as well. Is there a risk of multiple empty directories causing problems later? As far as I can tell, there aren't any problems with that, and does seem logically sound.

--- David A. Wheeler
Previous: Petr BaudisNext: H. Peter Anvin
Message 3 of 7 in “commit-id fails after cg-init”
  1. Pavel RoskinMay 3, 2005
  2. Petr BaudisMay 3, 2005
  3. David A. WheelerMay 4, 2005
  4. H. Peter AnvinMay 4, 2005
  5. Alexey NezhdanovMay 5, 2005
  6. David A. WheelerMay 6, 2005
  7. Joel BeckerMay 3, 2005

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.