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

Re: [PATCH v4] rev-list: refuse --first-parent combined with --bisect

From
SSScott Schmit <i.grok@comcast.net>
Date
Mar 20, 2015, 13:02 UTC
Message-ID
<20150320130235.GA18772@odin.ulthar.us>
In-Reply-To
<xmqqbnjsrcyz.fsf@gitster.dls.corp.google.com>
On Mon, Mar 16, 2015 at 11:53:08AM -0700, Junio C Hamano wrote:
Show 60 quoted lines
> Because the history is not linear in Git, bisection works by
> shrinking a subgraph of the history DAG that contains "yet to be
> tested, suspected to have introduced a badness" commits.  The
> subgraph is defined as anything reachable from _the_ "bad" commit
> (initially, the one you give to the command when you start) that are
> not reachable from any of the "good" commits.
> 
> Suppose you started from this graph.  Time flows left to right as
> usual.
> 
>   ---0---2---4---6---8---9
>       \             /
>        1---3---5---7
> 
> Then mark the initial good and bad commits as G and B.
> 
>   ---G---2---4---6---8---B
>       \             /
>        1---3---5---7
> 
> And imagine that you are asked to check 4, which turns out to be
> good.  We do not _move_ G to 4; we mark 4 as good, while keeping
> 0 also as good.
> 
>   ---G---2---G---6---8---B
>       \             /
>        1---3---5---7
> 
> And if you are next asked to check 5, and mark it as good, the graph
> will become like this:
> 
>   ---G---2---G---6---8---B
>       \             /
>        1---3---G---7
> 
> Of course, at this point, the subgraph of suspects are 6, 7, 8 and
> 9, and the subgraph no longer is affected by the fact that 0 is
> good.  But it is crucial to keep 0 marked as good in the step before
> this one, before you tested 5, as that is what allows us not having
> to test any ancestors of 0 at all.
> 
> Now, one may wonder why we need multiple "good" commits but we do
> not need multiple "bad" commits.  This comes from the nature of
> "bisection", which is a tool to find a _single_ breakage [*1*], and
> a fundamental assumption is that a breakage does not fix itself.
> 
> Hence, if you have a history that looks like this:
> 
> 
>    G...1---2---3---4---6---8---B
>                     \
>                      5---7---B
> 
> it follows that 4 must also be "bad".  It used to be good long time
> ago somewhere before 1, and somewhere along way on the history,
> there was a single breakage event that we are hunting for.  That
> single event cannot be 5, 6, 7 or 8 because breakage at say 5 would
> not explain why the tip of the upper branch is broken---its breakage
> has no way to propagate there.  The breakage must have happened at 4
> or before that commit.

But what if 7 & 8 are the same patch, cherry-picked? Or nearly the same patch, but with some conflict resolution?

Couldn't that lead to the case that 4, 5, and 6 are good, while 7 & 8 are bad? Or does that violate the "single breakage" rule in a way that might be too subtle for some users?

-- 
Scott Schmit
Previous: Philip OakleyNext: Kevin Daudt
Message 29 of 32 in “[BUG] Segfault with rev-list --bisect”
  1. Troy MoureMar 3, 2015
  2. Jeff KingMar 4, 2015
  3. Junio C HamanoMar 4, 2015
  4. Troy MoureMar 5, 2015
  5. rev-list: refuse --first-parent combined with --bisectKevin Daudt, Mar 7, 2015
  6. Kevin DaudtMar 7, 2015
  7. Junio C HamanoMar 8, 2015
  8. rev-list: refuse --first-parent combined with --bisectKevin Daudt, Mar 8, 2015
  9. rev-list: refuse --first-parent combined with --bisectKevin Daudt, Mar 8, 2015
  10. rev-list: refuse --first-parent combined with --bisectKevin Daudt, Mar 8, 2015
  11. Eric SunshineMar 8, 2015
  12. Kevin DaudtMar 9, 2015
  13. rev-list: refuse --first-parent combined with --bisectKevin Daudt, Mar 9, 2015
  14. Junio C HamanoMar 10, 2015
  15. Kevin DaudtMar 10, 2015
  16. Junio C HamanoMar 10, 2015
  17. Kevin DaudtMar 11, 2015
  18. Junio C HamanoMar 11, 2015
  19. Kevin DaudtMar 16, 2015
  20. Junio C HamanoMar 16, 2015
  21. Philip OakleyMar 16, 2015
  22. Junio C HamanoMar 16, 2015
  23. Christian CouderMar 17, 2015
  24. Junio C HamanoMar 17, 2015
  25. Christian CouderMar 17, 2015
  26. Junio C HamanoMar 17, 2015
  27. Christian CouderMar 18, 2015
  28. Philip OakleyMar 19, 2015
  29. Scott SchmitMar 20, 2015
  30. rev-list: refuse --first-parent combined with --bisectKevin Daudt, Mar 19, 2015
  31. Junio C HamanoMar 19, 2015
  32. Kevin DaudtMar 21, 2015

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.