Re: mktree: multiple same-named objects

2014-08-27 Thread David Turner
On Wed, 2014-08-27 at 12:01 +0700, Duy Nguyen wrote: > On Wed, Aug 27, 2014 at 11:41 AM, David Turner > wrote: > > Summary: git mktree ought to forbid this, and possibly there ought to be > > other checks (for instance, when unpacking) to prevent this. > > Does fsck detect this (because we ought

Re: mktree: multiple same-named objects

2014-08-27 Thread Jeff King
On Wed, Aug 27, 2014 at 08:17:15AM -0700, Junio C Hamano wrote: > I am somewhat against outright removing the capability to write out > invalid objects deliberately from these low level tools, because we > would need a way to easily reproduce bugs in end-user facing tools > by other people who cla

Re: mktree: multiple same-named objects

2014-08-27 Thread Junio C Hamano
Jeff King writes: > On Wed, Aug 27, 2014 at 12:41:57AM -0400, David Turner wrote: > >> git mktree seems to allow the creation of a tree object with multiple >> objects of the same name but different SHAs. > > Yeah, I don't think we do many quality checks there. Ditto for "git > hash-object". I a

Re: mktree: multiple same-named objects

2014-08-26 Thread Jeff King
On Wed, Aug 27, 2014 at 12:41:57AM -0400, David Turner wrote: > git mktree seems to allow the creation of a tree object with multiple > objects of the same name but different SHAs. Yeah, I don't think we do many quality checks there. Ditto for "git hash-object". The latter goes through index_mem

Re: mktree: multiple same-named objects

2014-08-26 Thread Duy Nguyen
On Wed, Aug 27, 2014 at 11:41 AM, David Turner wrote: > Summary: git mktree ought to forbid this, and possibly there ought to be > other checks (for instance, when unpacking) to prevent this. Does fsck detect this (because we ought to fix fsck first if it does not)? -- Duy -- To unsubscribe from

mktree: multiple same-named objects

2014-08-26 Thread David Turner
git mktree seems to allow the creation of a tree object with multiple objects of the same name but different SHAs. This leads to weird behavior later, unsurprisingly. For instance, if there are two tree objects with the same name but different SHAs, the checked out tree will be the union of them