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

Re: [RFC] Add bad-branch-first option for git-bisect

From
SHShuang He <shuang.he@intel.com>
Date
Jan 25, 2011, 03:27 UTC
Message-ID
<4D3E432B.70905@intel.com>
In-Reply-To
<7v8vyam5la.fsf@alter.siamese.dyndns.org>
On 2011/1/25 4:04, Junio C Hamano wrote:
Show 15 quoted lines
> Shuang He<shuang.he@intel.com>  writes:
>
>> If A is bad commit, and C fixed it, and then F is bad again,
>>
>> A ->   B ->   C ->   D ->   E ->   F ->   G ->   H   (master)
>>    \                    \      /
>>      a  ->   b... c ->   d ->   e->f  (feature 1)
>>
>> Start with H as bad commit, and D as good commit, it's possible git-bisect would jump to c, and it will lead to wrong direction
>>
>> If bad-branch-first is used, it would be:
>> 1. first round found F
>> 2. end
> It is unclear from the way you drew the picture if "F" is supposed to be a
> merge of "E" and "f", but I'd assume that it is.

Oh, I lost this mail That graph is different from what I meant, when shown in different email client. It's G which is merged from e and F

Show 7 quoted lines
> So what you are saying in 1. is "skip from H until you hit a first merge
> (without testing any intermediate commit), find F and stop to check it,
> and find that it is broken".
>
> What makes you decide "2. end"?  The fact that both of its parents "E" and
> "f" are Ok?  IOW, it won't be "2. end" if one of the parents of the merge
> is broken?
I think the correction above should have answer those two questions.
Show 10 quoted lines
> What if there is _no_ merge from a side branch but there were breakages in
> A (fixed in C) and then F in your original picture, i.e.
>
>    A---B---C---D---E---F---G---H (broken)
>    x       o           x
>
> and you are hunting for the bug starting from H?  How does your algorithm
> help?  I grossed over the linear part by saying "skip from H until you hit
> a first merge", but in general, what is your plan to handle linear part of
> the history?

If the history is linear, the new algorithm won't help, it will just behavior like default git-bisect algorithm.

Show 12 quoted lines
> A totally unacceptable answer is "It does not help linear case, but it
> helps when there are merges".  The a-thru-f side branch in your picture,
> or any "culprit side branch that was merged" your algorithm finds in
> general, would eventually have a linear segment, and having x-o-x in the
> history fundmentally breaks "bisect"---your band-aid will not help.
>
> The whole idea behind using "bisect" to gain efficiency in isolating the
> issue depends on "Once you see a Good commit, you do not have to search
> beyond its ancestors", as it is to look for a single breakage that
> persists to the "Bad" commit you give, and as far as "bisect" is
> concerned, the breakage at A in your example is an unrelated breakage that
> did not persist through the history to the "Bad" commit H.

In the example above (after we know G is merged from e and F), Those commits are old bad commit: A, B, a, b, ..., c, d (but we don't care about those old bad commits, we cared about latest bad commit that we met which is F) It's possible that default git-bisect would jump to these old bad commits, and will finally find an old first bad commit With bad-branch-first, it could help us to get away from the trouble that old culprit commit exist on feature1 branch for a period of time not fixed

Thanks
     --Shuang
Previous: Junio C HamanoNext: Christian Couder
Message 8 of 14 in “[RFC] Add bad-branch-first option for git-bisect”
  1. Shuang HeJan 24, 2011
  2. add config option core.bisectbadbranchfirstShuang He, Jan 24, 2011
  3. Christian CouderJan 24, 2011
  4. Shuang HeJan 24, 2011
  5. Johannes SixtJan 24, 2011
  6. Shuang HeJan 24, 2011
  7. Junio C HamanoJan 24, 2011
  8. Shuang HeJan 25, 2011
  9. Christian CouderJan 25, 2011
  10. Shuang HeJan 26, 2011
  11. Christian CouderJan 26, 2011
  12. Shuang HeJan 26, 2011
  13. Avery PennarunJan 24, 2011
  14. Shuang HeJan 26, 2011

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.