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

inexplicable failure to merge recursively across cherry-picks

From
MKmartin f krafft <madduck@madduck.net>
Date
Oct 10, 2007, 01:55 UTC
Message-ID
<20071010015545.GA17336@lapse.madduck.net>
Hi folks,

I hope this is not a daily series of mine, being confused about Git merging, but I've run my head against a wall again and before I crush my skull, I'd prefer to reach out to you to help me regain an understanding.

This is about the new mdadm for Debian packaging effort. You can clone from git://git.debian.org/git/pkg-mdadm/mdadm-new.git and see the repo at http://git.debian.org/?p=pkg-mdadm/mdadm-new.git;a=summary. Do not track as this repo is subject to change.

My master branch was last merged with upstream's mdadm-2.6.2 tag (commit 263a535). Since then, I've committed a couple of changes to master including three cherry-picks from upstream since mdadm-2.6.2.

I tagged upstream at the point which I want to merge into master: mdadm-2.6.3+200709292116+4450e59. When I merge that tag into master, I get a merge conflict on Monitor.c:

  <<<<<<< HEAD:Monitor.c
                                  if (mse->devnum != MAXINT &&
  =======
                                  if (mse->devnum != INT_MAX &&
  >>>>>>> upstream:Monitor.c

There are five commits between mdadm-2.6.2 and mdadm-2.6.3+200709292116+4450e59 that affect Monitor.c:

  01d9299
  e4dc510
* 66f8bbb
  98127a6
  4450e59

The third commit, the one with the asterisk is the one that I cherry-picked (as 845eef9); the other two cherries I picked do not touch Monitor.c.

The fifth/last commit (4450e59) is the one responsible for the change which seems to cause the conflict. It is the *only* commit since the common ancestor of *both* branches that touches the conflicting lines.

The fourth commit (98127a6) inserts a single line at the top of the file, so that's nothing that would cause a conflict.

To be honest, I can't explain it. But I didn't give up.

I branched master2 off 845eef9b~1, cherry-picked the first two commits that touch Monitor.c, cherry-picked all the commits 845eef9b..master into master2 and merge upstream...

... to get exactly the same conflict in exactly the same line in exactly the same file.

What is going on. Am I seriously overestimating Git's merging capacities, or do I have a bug in my brain?

-- 
martin;              (greetings from the heart of the sun.)
  \____ echo mailto: !#^."<*>"|tr "<*> mailto:" net@madduck
 
"the only difference between shakespeare and you
 was the size of his idiom list -- not the size of his vocabulary."
                                                      -- alan perlis
 
spamtraps: madduck.bogus@madduck.net
Next: Linus Torvalds
Message 1 of 11 in “inexplicable failure to merge recursively across cherry-picks”
  1. martin f krafftOct 10, 2007
  2. Linus TorvaldsOct 10, 2007
  3. martin f krafftOct 10, 2007
  4. David KastrupOct 10, 2007
  5. Linus TorvaldsOct 10, 2007
  6. David BrownOct 10, 2007
  7. Miklos VajnaOct 10, 2007
  8. Linus TorvaldsOct 10, 2007
  9. Miklos VajnaOct 11, 2007
  10. Sam VilainOct 11, 2007
  11. Linus TorvaldsOct 11, 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.