Subject: Re: Git files data formats documentation

From: Shawn Pearce <[email-masked]>
Date: Sat, 5 Aug 2006 15:30:46 -0400

Junio C Hamano <[email-masked]> wrote:
> 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.