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

Re: [RFC/PATCH] merge: loosen overcautious "working file will be lost" check.

From
Junio C Hamano <junkio@cox.net>
Date
Oct 9, 2006, 22:47 UTC
Message-ID
<7vy7rp9kdz.fsf@assigned-by-dhcp.cox.net>
In-Reply-To
<20061009172053.48882.qmail@web31804.mail.mud.yahoo.com>
Luben Tuikov <ltuikov@yahoo.com> writes:
Show 18 quoted lines
> I think this is a good thing.
>
> How about this case I've noticed in my trees:
>
> After branching out, a file is deleted, only to add
> a different file with the same file name.
>
> Then any time I pull in from the trunk to merge,
> merge fails with git-diff-files showing all 0's and the
> file name in question.  Picture:
>
>   Branch B       +-----------------M1---->
>                 /                 /
>                C2 <-- git-add A  /
>               /                 /
>              C1 <-- git-rm A   /
>             /                 /
> Trunk -----+-----------------+---->

Sorry I do not understand the picture; where is the common ancestor? If it is the left plus sign on the Trunk line, and you are talking about what happens when making the merge M1, then before C1 A did not exist (so Trunk tip which is the right plus sign on the Trunk line would not either), and the other head (tip of branch B you are pulling the trunk into) would have one already (from C2), so I would imagine it would be "one side adds while the other did not touch" (net effect since branch B forked from trunk is an addition of A, while Trunk did not do anything with respect to path A), so I do not see where any conflict can come from. Puzzled.

Previous: Luben TuikovNext: Luben Tuikov
Message 6 of 12 in “"fatal: Untracked working tree file 'so-and-so' would be overwritten by merge"”
  1. Linus TorvaldsOct 9, 2006
  2. Junio C HamanoOct 9, 2006
  3. Junio C HamanoOct 9, 2006
  4. merge: loosen overcautious "working file will be lost" check.Junio C Hamano, Oct 9, 2006
  5. Luben TuikovOct 9, 2006
  6. Junio C HamanoOct 9, 2006
  7. Luben TuikovOct 10, 2006
  8. Junio C HamanoOct 10, 2006
  9. Luben TuikovOct 10, 2006
  10. Linus TorvaldsOct 9, 2006
  11. Junio C HamanoOct 9, 2006
  12. Junio C HamanoOct 10, 2006

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.