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

Re: Strange merge failure (would be overwritten by merge / cannot merge)

From
Linus Torvalds <torvalds@linux-foundation.org>
Date
Sep 6, 2009, 20:42 UTC
Message-ID
<alpine.LFD.2.01.0909061338350.8946@localhost.localdomain>
In-Reply-To
<7vws4bzu7w.fsf@alter.siamese.dyndns.org>
On Sun, 6 Sep 2009, Junio C Hamano wrote:
Show 15 quoted lines
> 
> 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
Previous: Junio C HamanoNext: Linus Torvalds
Message 11 of 16 in “Strange merge failure (would be overwritten by merge / cannot merge)”
  1. Christoph HaasSep 4, 2009
  2. David AguilarSep 4, 2009
  3. Christoph HaasSep 5, 2009
  4. Junio C HamanoSep 5, 2009
  5. Junio C HamanoSep 6, 2009
  6. Junio C HamanoSep 6, 2009
  7. Linus TorvaldsSep 6, 2009
  8. Junio C HamanoSep 6, 2009
  9. Linus TorvaldsSep 6, 2009
  10. Junio C HamanoSep 6, 2009
  11. Linus TorvaldsSep 6, 2009
  12. Linus TorvaldsSep 6, 2009
  13. Junio C HamanoSep 6, 2009
  14. Linus TorvaldsSep 6, 2009
  15. Linus TorvaldsSep 6, 2009
  16. Junio C HamanoSep 6, 2009

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.