# RE: git bisect and the merge from hell

2 messages from 2006-02-03 to 2006-02-03. Participants: Luck, Tony, Linus Torvalds.
Thread: https://gitlist.dev/t/3234

## Luck, Tony, 2006-02-03 23:16

Subject: RE: git bisect and the merge from hell
Message-ID: <B8E391BBE9FE384DAA4C5C003888BE6F059F4AF6@scsmsx401.amr.corp.intel.com>
URL: https://gitlist.dev/e/B8E391BBE9FE384DAA4C5C003888BE6F059F4AF6%40scsmsx401.amr.corp.intel.com

```
> "git bisect visualize" really makes it very obvious what to try next, I 
> think. Which exact commit you try next probably depends on what the 
> compile error was. I'd try
>
>	git reset --hard 3d5271f9883cba7b54762bc4fe027d4172f06db7
>
> (which is after the "pull release into acpica branch" commit).

Yup, that got the bisection moving again.  I finished up at:

$ git bisect bad
96db255c8f014ae3497507104e8df809785a619f is first bad commit
diff-tree 96db255c8f014ae3497507104e8df809785a619f (from 0897831bb54eb36fd9e2a22da7f0f64be1b20d09)
Author: Bob Moore <robert.moore@intel.com>
Date:   Wed Nov 2 00:00:00 2005 -0500

    [ACPI] ACPICA 20051102

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.

Thanks for the tip.

-Tony

```

## Linus Torvalds, 2006-02-03 23:44

Subject: RE: git bisect and the merge from hell
Message-ID: <Pine.LNX.4.64.0602031531440.3969@g5.osdl.org>
URL: https://gitlist.dev/e/Pine.LNX.4.64.0602031531440.3969%40g5.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

```
