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

Re: git rebase: unexpected conflict

From
Linus Torvalds <torvalds@linux-foundation.org>
Date
Feb 7, 2007, 20:22 UTC
Message-ID
<Pine.LNX.4.64.0702071214170.8424@woody.linux-foundation.org>
In-Reply-To
<7vr6t17ohb.fsf@assigned-by-dhcp.cox.net>
On Wed, 7 Feb 2007, Junio C Hamano wrote:
Show 5 quoted lines
> 
> That is because David Woodhouse has an evil merge at
> c45aa055c32b488fc3fd73c760df372b09acf69a.
> 
> Running "git show" on that commit would tell you the story.

It's not really "evil". It's just that our "--cc" strategy makes it look very odd. But if you then look at why it looks that odd, you can do:

	git diff 784f4d5..8dd851d drivers/mtd/nand/Kconfig

(those two sha1's are just the commits that got merged, as reported by "git show"), and you'll see what happened:

 - one branch added the MTD_NAND_CAFE entry
 - the other one had removed the MTD_NAND_AT91 entry
 - they were in the same location in the Kconfig file, so it was a real 
   data conflict
 - when David fixed it up, instead of just trivially selecting the config 
   entry that remained after the merge (MTD_NAND_CAFE), he *also* then 
   moved it to alphabetically the proper place in the file.

End result: doing a "git show" on the resulting commit does how something rather strange (the final result does indeed have lines that did not exist in *either* of the parents), but what it doesn't show is the cause of that strange thing, because that ended up being a non-conflict after the merge (ie remove the old entries from both files).

In general, the output of "--cc" for conflicting merges is really quite good, but it's can be a bit hard to read, and in cases like this, the "conflict" is shown in a way that doesn't exactly make the _original_ conflict obvious.

			Linus
Previous: Linus Torvalds
Message 16 of 16 in “git rebase: unexpected conflict”
  1. Michael S. TsirkinFeb 4, 2007
  2. Jakub NarebskiFeb 4, 2007
  3. Michael S. TsirkinFeb 4, 2007
  4. Junio C HamanoFeb 7, 2007
  5. Michael S. TsirkinFeb 7, 2007
  6. Junio C HamanoFeb 7, 2007
  7. Michael S. TsirkinFeb 7, 2007
  8. Junio C HamanoFeb 7, 2007
  9. Michael S. TsirkinFeb 7, 2007
  10. Junio C HamanoFeb 7, 2007
  11. Michael S. TsirkinFeb 8, 2007
  12. Junio C HamanoFeb 8, 2007
  13. Michael S. TsirkinFeb 8, 2007
  14. Michael S. TsirkinFeb 9, 2007
  15. Linus TorvaldsFeb 7, 2007
  16. Linus TorvaldsFeb 7, 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.