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

Re: tree sorting..

From
Linus Torvalds <torvalds@linux-foundation.org>
Date
Mar 16, 2007, 23:35 UTC
Message-ID
<Pine.LNX.4.64.0703161632270.3910@woody.linux-foundation.org>
In-Reply-To
<20070316231329.GA4508@spearce.org>
On Fri, 16 Mar 2007, Shawn O. Pearce wrote:
> 
> The entire reason this happened is hysterical raisins.  Your first
> draft of Git had trees as one flat structure, sorting complete
> paths by their memcmp result.  Which is dead simple and worked.
No. 
It's *not* historical reasons. That's what I tried to explain.

It's absolutely *required*. Not because of the old flat layout, but because we want read-tree to translate 1:1 into the index.

And the index is a flat file. And it *needs* to be a flat file, because we need to open it and read it efficiently. If it wasn't a flat file, we'd have all the index operations taking as long as the tree operations take.

> Now we are stuck with it.

No. How you need to accept it. It's that easy. It's not "stuck". It's "correct".

That's why I reacted to your irc thing. You seemed to think (and still apparently do) that the sorting is some messy mistake. It's anything but.

So yes, "foo" is *different* from "foo/". You just need to realize that they are two totally different entries. They have absolutely no relationship what-so-ever with each other, except that you obviously must not add one when the other exists.

		Linus
Previous: Shawn O. Pearce
Message 2 of 2 in “Re: tree sorting..”
  1. Shawn O. PearceMar 16, 2007
  2. Linus TorvaldsMar 16, 2007

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.