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

Re: Git bisect does not find commit introducing the bug

From
Philip Oakley <philipoakley@iee.org>
Date
Feb 18, 2017, 22:10 UTC
Message-ID
<6545FDC46D2741A289D0D5E9A84ADD75@PhilipOakley>
In-Reply-To
<CAMX8fZW2y+iPRfSbXVcHufbM+CsqgekS_0WnCEJ++=njy_TvKg@mail.gmail.com>
From: "Alex Hoffman" <spec@gal.ro>
Show 17 quoted lines
>> But this is not how Git works. Git computes graph differences, i.e., it
>> subtracts from the commits reachable from v.bad those that are reachable
>> from v.good. This leaves more than just those on some path from v.good to
>> v.bad. And it should work this way. Consider this history:
>>
>> --o--o--o--G--X
>>    \           \
>>     x--x--x--x--X--B--
>>
>> When you find B bad and G good, than any one of the x or X may have
>> introduced the breakage, not just one of the X.
>>
>
> Thank you for clarifying how git bisect works. How did you find that
> out? Did you check the source code? If that is not documented in the
> man page may be it worth documenting it in order to avoid future
> confusion for other users.

Any suggestions for improving the documentation are always worthwhile. As someone who asked, what extra info would have helped?

Even beetter if it looks like a patch ;-)
Show 42 quoted lines
>
> Let's consider your example with distinct names for nodes:
>
> --o1--o2--o3--G--X1
>    \                \
>     x1--x2--x3--x4--X1--B--
>
> It makes sense that git bisect is expecting a single transition, as
> this is a precondition for a binary search to work. My definition of
> "the transition" is a commit with at least one of its parents as a
> good version, but the commit itself a bad version. I hope we agree
> that git bisect's mission is to search for this transition (as I
> suppose that most of people need such a functionality from git, if not
> exactly from git bisect). How could be x1 or x3 be the transition, if
> chances are that o1 is not a good version? Of course it would make
> sense to me if bisect would check o1 whether good and only then to
> check also x1-x3, but this is not what git makes (at least not in my
> initial example).
>
> If you consider that git bisect's mission is different from finding
> the transition, could you please explain what exact commit git bisect
> is supposed to return (ideally with terms from the graph theory) and
> when it makes sense to return that? Because I do not see any sense in
> looking in the path x1-x3 without knowing that those commits may be a
> transition.
>
>
>> Oh, IMO git bisect was well thought through. If it considered just paths
>> from good to bad, it would not given the correct answer. See the example
>> history above. Bisect authors would not have deemed that sufficiently 
>> good
>
> You definitely convinced me that git MUST search more than only in the
> paths between good and bad commits, as the good commit G does not have
> to be the first good commit (thank you for that). My problem/confusion
> is that it returns something that does not make sense to me, because
> it does not make sure it returns a transition.
>
> VG
>
> PS: thank you for continuing this discussion.
>

-- Philip

Previous: Junio C HamanoNext: Hilco Wijbenga
Message 24 of 26 in “Git bisect does not find commit introducing the bug”
  1. Alex HoffmanFeb 17, 2017
  2. Stephan BeyerFeb 17, 2017
  3. Johannes SixtFeb 18, 2017
  4. Alex HoffmanFeb 18, 2017
  5. Johannes SixtFeb 18, 2017
  6. Alex HoffmanFeb 18, 2017
  7. Christian CouderFeb 18, 2017
  8. Alex HoffmanFeb 19, 2017
  9. Alex HoffmanFeb 19, 2017
  10. Christian CouderFeb 19, 2017
  11. Johannes SixtFeb 19, 2017
  12. Alex HoffmanFeb 19, 2017
  13. Jacob KellerFeb 19, 2017
  14. Oleg TaranenkoFeb 20, 2017
  15. Jakub NarębskiFeb 20, 2017
  16. Oleg TaranenkoFeb 20, 2017
  17. Alex HoffmanFeb 20, 2017
  18. Jakub NarębskiFeb 20, 2017
  19. Alex HoffmanFeb 20, 2017
  20. Philip OakleyFeb 20, 2017
  21. Alex HoffmanFeb 21, 2017
  22. Philip OakleyFeb 21, 2017
  23. Junio C HamanoFeb 20, 2017
  24. Philip OakleyFeb 18, 2017
  25. Hilco WijbengaFeb 18, 2017
  26. Johannes SixtFeb 18, 2017

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.