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

git merge no longer handles add/add

From
Martin Langhoff <martin.langhoff@gmail.com>
Date
Nov 19, 2007, 03:18 UTC
Message-ID
<46a038f90711181918s2743137amc6a827db6d1a6a0@mail.gmail.com>

git used to be really good at merging 2 branches that had gotten the same code added independently. Right now, both master (1.5.3.5.737.gdee1b) and next (9445b41) are telling me that the exact same file (same sha1), with the same mode added on 2 branches is a merge conflict. On _one_ of the branches there is an extra commit.

Hmmm.

I am pretty sure that early git (pre 1.0) could handle this correctly. I remember sending git-archimport to Junio and immediately doing 3 or 4 commits on top, and having the next pull work correctly without conflict because the merge machinery spotted the "last common sha1" for that file and saw that only one side had changed since then.

Happens with recursive and resolve. Happy to provide a minimal repro case, but I think this is fairly obvious...

cheers,
martin
Next: Martin Langhoff
Message 1 of 8 in “git merge no longer handles add/add”
  1. Martin LanghoffNov 19, 2007
  2. Martin LanghoffNov 19, 2007
  3. Junio C HamanoNov 19, 2007
  4. Martin LanghoffNov 19, 2007
  5. J. Bruce FieldsNov 19, 2007
  6. Junio C HamanoNov 19, 2007
  7. Jakub NarebskiNov 19, 2007
  8. Johannes SchindelinNov 20, 2007

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.