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

RE: git bisect and the merge from hell

From
Linus Torvalds <torvalds@osdl.org>
Date
Feb 3, 2006, 23:44 UTC
Message-ID
<Pine.LNX.4.64.0602031531440.3969@g5.osdl.org>
In-Reply-To
<B8E391BBE9FE384DAA4C5C003888BE6F059F4AF6@scsmsx401.amr.corp.intel.com>
On Fri, 3 Feb 2006, Luck, Tony wrote:
> 
> So Len's mega-octopus merge wasn't a problem at all, but this is still
> all his fault :-)  I'll go beat on him.
Note that this _can_ be a problem with huge octopus merges.

If some bug only appears as a result of the interaction of two branches, doing a 12-way merge will make it harder to debug. Doing a "git bisect" will (correctly) pinpoint the merge as being the problem, but after that you're on your own as to how to debug it.

So _if_ it had been a merge error, there's two issues with that:
 - debugging merges is usually a bit less straightforward than debugging a 
   single well-defined changeset anyway.
 - especially an octopus-merge will cause "git-bisect" to be less 
   efficient, since it cannot be bisected, so if the bug is in the merge 
   itself, it will ask you to test _every_ _single_ top-of-branch before 
   the merge.

(Normally, testing 12 kernels would zoom in on a bug from 10.000 feet, and you'd have bisected a massive four-thousand commits. So having to test 12 branch heads just to pinpoint a _single_ commit is "unusually expensive" by any standard for git bisection).

Anyway, had it been a merge bug, you should then have done:
 - check if it's simply a mis-merge. Do "git-diff-tree --cc" to see if 
   there were any conflicts, and check them out more closely to see 
   if maybe they were incorrectly fixed up.
   Normally, an octopus merge will never have any actual _manual_ 
   conflicts (the standard git tools shouldn't allow it), but there can 
   still be several branches that touch the same area and that could have 
   merged strangely.

If that doesn't get you anywhere, you'll literally have to go to the next step:

 - re-do the merges one by one, until the bug appears, or, if it's not 
   there once you've re-done them all, check what the differences are 
   (there _should_ be none, but see above on doing mis-merging) with the 
   final octopus one.

Anyway, for "normal" bugs (like this one apparently is), git-bisect shouldn't ever pinpoint a merge, since the bug hopefully was introduced somewhere _during_ the branch development, and not when it was merged back. Hopefully.

Anyway. The message you should take home from this is that "git bisect" handles merges perfectly well, and that at worst it might be less efficient and harder to debug - especially for octopus merges - but that both of those problems are likely (a) rare and (b) not insurmountable.

		Linus
Previous: Luck, Tony
Message 2 of 2 in “RE: git bisect and the merge from hell”
  1. Luck, TonyFeb 3, 2006
  2. Linus TorvaldsFeb 3, 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.