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

Re: Git files data formats documentation

From
Shawn Pearce <spearce@spearce.org>
Date
Aug 5, 2006, 19:30 UTC
Message-ID
<20060805193046.GA20565@spearce.org>
In-Reply-To
<7vac6jfzem.fsf@assigned-by-dhcp.cox.net>
Junio C Hamano <junkio@cox.net> wrote:
Show 12 quoted lines
> Not quite.  An entry for a subtree is sorted as if a '/' is
> suffixed to its name.
> 
>         $ git ls-tree $T
>         100644 blob 2398e9f8892812607f5eee6ed0d5712c2e3de197	a-
>         100644 blob 7f07527a80bd8c2b1c5087d7ccfe61073b068374	a-b
>         040000 tree 23fddf6a57ff3ba98aa93fb71431276c3f1a3c40	a
>         100644 blob 2afe6dcc5466068b8dcc7263cece05d2adf044fe	a=
>         100644 blob efc73add7dd868242a66faf2a59b145f2a60b834	a=b
> 
> This is, by the way, consistent with the order of cache entries
> in the index file.

Arrrrgh. I didn't realize that '/' was needed on the end of a tree name when sorting its parent for output. jgit was/is definately doing this wrong. And it all comes back to how the index operates, doesn't it? :-)

I've got to go back now and do some surgery on how jgit sorts entries in a tree. Clearly it would be incorrect with the example you just gave. It also would have thought that core GIT generated a corrupt tree if it tried to read in your example. Thank you for taking the time to clarify it!

-- 
Shawn.
Previous: Junio C HamanoNext: A Large Angry SCM
Message 4 of 13 in “Git files data formats documentation”
  1. A Large Angry SCMAug 5, 2006
  2. Jon SmirlAug 5, 2006
  3. Junio C HamanoAug 5, 2006
  4. Shawn PearceAug 5, 2006
  5. A Large Angry SCMAug 5, 2006
  6. Junio C HamanoAug 6, 2006
  7. Shawn PearceAug 5, 2006
  8. A Large Angry SCMAug 5, 2006
  9. Jakub NarebskiAug 5, 2006
  10. A Large Angry SCMAug 5, 2006
  11. Jakub NarebskiAug 5, 2006
  12. A Large Angry SCMAug 5, 2006
  13. Nicolas PitreAug 16, 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.