Re: Supressing sorting of trees

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

On Mon, 12 Oct 2009, Sal Mangano wrote:

> Shawn O. Pearce <spearce <at> spearce.org> writes:
> 
> > 
> > Sal Mangano <smangano <at> into-technology.com> wrote:
> > > I am using Git in a non-standard way and need to make a few twaeks 
> > > in my custom build. I have added a --nosort option to git mktree 
> > > which will suppress the qsort of the tree.
> > > 
> > > Will this break any other git functions? Are there any commands that 
> > > assume trees are always sorted?
> > 
> > _YES IT BREAKS GIT_.
> > 
> > You cannot do this.
> > 
> > A Git repository whose trees are not sorted according to the Git 
> > specific sort ordering is severly broken and most tools will fail 
> > horribly on it.
> > 
> > Almost all code which reads trees assumes the names are sorted in a 
> > specific order.  These tools perform sorted merges against other tree 
> > like structures.  If the names are out of order the merge will fail. 
> > `git fsck` will complain that the tree is not sorted properly. Tools 
> > like `git log -- foo.c` will fail randomly because they break out of 
> > the entry lookup as soon as they find a name that is after foo.c, as 
> > they assume the tree is sorted.
> > 
> > I could go on.  But there is no point.
> > 
> > Oh, and trust me when I say this, the tree sorting matters.  Long ago 
> > JGit had a bug where it didn't sort trees correctly all of the time 
> > and we had a devil of a time tracking down that corruption.
> > 
> 
> Thanks Shawn. I get the picture. 
> 
> Now, let's assume I am stubborn, crazy or both :-)
> 
> I can modify fsck to ignore unsorted and at the moment I don't care 
> about merging trees. If I hunt down all usage of base_name_compare will 
> that identify all code with the sort assumption or is there other places 
> as well? I can go > through the entire source to figure this out myself 
> but I need to get something hacked up very quickly and would appreciate 
> help even if you think I am nuts!

Look, one of the most trusted Git contributors just told you that you are 
asking for trouble.

It has nothing to do with being stubborn if you insist on doing it now.

But I smell an XY problem.  Why don't you just reveil _what_ you want to 
do (as opposed to _how_ you think you should do it)?

Ciao,
Dscho

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]