From: Linus Torvalds Date: Sun, 06 Sep 2009 20:42:24 GMT Subject: Re: Strange merge failure (would be overwritten by merge / cannot merge) Message-ID: In-Reply-To: <7vws4bzu7w.fsf@alter.siamese.dyndns.org> On Sun, 6 Sep 2009, Junio C Hamano wrote: > > The reason I brought up adding the "candidate for the earliest name" > interface to the function was to avoid a case where the index has > > blob "t" > blob "t-f" > > and all the trees being merged have > > blob "t-f" > tree "t" > > in which case the "Are we supposed to look at the index too?" logic in > unpack_callback() may not catch the "t-f" entry from the index when the > first callback from traverse_trees() feeds it "t-f". I agree. It's why I initially wanted to do it _all_ in the unpack_callback() thing, but the more I tried, the more complex it got. So now my plan is to do the conflict handling at a tree level in traverse_trees(), and get rid of the use of 'df_name_compare()' just there first. The index case is slightly easier, as we can go back-and-forth in the source index (we do try to avoid it right now, but that's a small optimization rather than anything fundamental), so the index we can traverse in a more flexible manner, and find the 't' conflict that way. Linus