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

Re: [PATCH/RFC] Add [] as an alias for a reference to the empty tree

From
Jeff King <peff@peff.net>
Date
May 10, 2010, 09:20 UTC
Message-ID
<20100510092054.GA2602@coredump.intra.peff.net>
In-Reply-To
<A612847CFE53224C91B23E3A5B48BAC74482E511E7@xmail3.se.axis.com>
On Mon, May 10, 2010 at 10:14:15AM +0200, Peter Kjellerstedt wrote:
Show 5 quoted lines
> However, if INDEX, WORKTREE and EMPTY are preferred as syntactic sugar
> tokes, then that is fine by me. Unfortunately, I do not have the time
> nor the knowledge needed to add support for the INDEX and WORKTREE 
> tokens, so I am afraid I will have to leave this as a suggestion for 
> the future.

Implementing INDEX and WORKTREE would be quite challenging. EMPTY is easy because it is really just a fake ref for a particular sha1. The others need special casing everywhere that might look at the result.

So certainly if you want to do EMPTY, I wouldn't let the lack of the other two hold you back. The only reason they are related at all is that they would probably share a syntax, if the other two ever even get implemented.

-Peff
Previous: Peter KjellerstedtNext: Sverre Rabbelier
Message 7 of 10 in “Add [] as an alias for a reference to the empty tree”
  1. Add [] as an alias for a reference to the empty treePeter Kjellerstedt, May 7, 2010
  2. Jeff KingMay 8, 2010
  3. Junio C HamanoMay 8, 2010
  4. Jeff KingMay 8, 2010
  5. Jonathan NiederMay 8, 2010
  6. Peter KjellerstedtMay 10, 2010
  7. Jeff KingMay 10, 2010
  8. Sverre RabbelierMay 10, 2010
  9. Jeff KingMay 10, 2010
  10. Sverre RabbelierMay 10, 2010

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.