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

Re: Git bisect does not find commit introducing the bug

From
AHAlex Hoffman <spec@gal.ro>
Date
Feb 19, 2017, 12:43 UTC
Message-ID
<CAMX8fZWarm6wqtaazkWiUeSdsw_FThxWV1U6zV0iEtssdmvrOw@mail.gmail.com>
In-Reply-To
<CAMX8fZVeAEJ5tfCO_4Pebnq=rysaJ2xDMjH-9pjmPeF4FziLFw@mail.gmail.com>
Below is a correction of the first proposed algorithm:
Show 6 quoted lines
>--o1--o2--o3--G --X1
>    \                \
>     x1--x2--x3--x4--X2--B--
>      \              /
>       y1--y2--y3
>
Step 1a. (Unchanged) keep only the commits that:
        a) are ancestor of the "bad" commit (including the "bad" commit itself),
        b) are not ancestor of a "good" commit (excluding the "good" commits).
The following graph results:
      x1--x2--x3--x4--X2--B--
       \              /
        y1--y2--y3

Step 1b. (New) Mark all commits of the resulting graph as unconfirmed (unconfirmed=node without good ancestors). Mark as confirmed all descendants of commits that user marked explicitly as good (e.g if user already marked its parent/grand parent/... as good right before starting bisect run). Step 1c. From all unconfirmed root commits build a set SET_GOOD of those with any good parents in the original graph (root commit = commit without parents in the resulting graph) and one SET_BAD for commits with only BAD parents. To build a set means to ask explicitly the user (or the command passed in git bisect run) whether any of its parents is good. In the example above find out whether x1 has any good parents or no parent at all and if so add it to SET_GOOD, otherwise to SET_BAD. Mark as confirmed each commit in SET_GOOD and all its descendants. For every commit in SET_BAD delete all paths from it until to the next confirmed commit. In the example above if x1 is in SET_BAD delete the path x1-x3 and x1-y3. If any new root commits result (commit x4), redo step 1c with them.

Step2. Continue the existing algorithm.
If this improvement works (i.e you do not find any bugs in it and it
is feasible to implement, which seems to me) the following would be
its advantages:
1. An assumption less, as we explicitly check the assumption.
2. It might be quicker, because we delete parts of graph that cannot
contain transitions.
3. It returns more exact results.
VG
Previous: Alex HoffmanNext: Christian Couder
Message 9 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.