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

Re: Parallel refactoring and git merge nightmare

From
Jeff King <peff@peff.net>
Date
Apr 12, 2012, 05:41 UTC
Message-ID
<20120412054155.GB27369@sigill.intra.peff.net>
In-Reply-To
<1334160803.74554.YahooMailNeo@web160603.mail.bf1.yahoo.com>
On Wed, Apr 11, 2012 at 09:13:23AM -0700, Pap Lôrinc wrote:
Show 6 quoted lines
> I think the 
> problem arises because git doesn't track
>  moves, therefore I constantly get conflicts of type "local modified, 
> remote deleted" (or even both deleted) when in fact it was only modified
>  and moved, it could have been merged without conflicts (-> apply my 
> changes and move the file to the new location).

Git does rename detection at the time of merge, and will apply changes to the destination file. I'm not sure why this isn't working for you. Some theories:

  1. Git may give up on finding renames if it is very computationally
     expensive. It will print a warning in that case, but you may miss
     it in the output. You might try:
        git config merge.renamelimit 0
     to turn off the limiting.
  2. Do your files actually look like renames? Git's inexact rename
     detection looks at the file content, and correlates removed and
     added files that have a high percentage of similar content. If most
     of the file ended up changed, then the pair is not considered a
     rename.
-Peff
Previous: Eugene Sajine
Message 9 of 9 in “Parallel refactoring and git merge nightmare”
  1. Pap LôrincApr 11, 2012
  2. Michael WittenApr 11, 2012
  3. David AguilarApr 12, 2012
  4. Pap LôrincApr 12, 2012
  5. Andrew ArdillApr 12, 2012
  6. David BarrApr 12, 2012
  7. Pap LôrincApr 12, 2012
  8. Eugene SajineApr 12, 2012
  9. Jeff KingApr 12, 2012

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.