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
Christian Couder <christian.couder@gmail.com>
Date
Mar 17, 2015, 16:09 UTC
Message-ID
<CAP8UFD12UX+3psD2=9_RsGv8JA2C8N54qAYGydYgr7n5ta7dzw@mail.gmail.com>
In-Reply-To
<xmqqr3sops9f.fsf@gitster.dls.corp.google.com>
On Mon, Mar 16, 2015 at 10:05 PM, Junio C Hamano <gitster@pobox.com> wrote:
Show 53 quoted lines
> "Philip Oakley" <philipoakley@iee.org> writes:
>
>> From: "Junio C Hamano" <gitster@pobox.com>
>>
>>> 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.
>>
>> Is it not worth at least confirming the assertion that 4 is bad before
>> proceding, or at least an option to confirm that in complex scenarios
>> where the fault may be devious.
>
> That raises a somewhat interesting tangent.
>
> Christian seems to be forever interested in bisect, so I'll add him
> to the Cc list ;-)
>
> There is no way to give multiple "bad" from the command line.  You
> can say "git bisect start rev rev rev..." but that gives only one
> bad and everything else is good.  And once you specify one of the
> above two bad ones (say, the child of 8), then we will not even
> offer the other one (i.e. the child of 7) as a candidate to be
> tested.  So in that sense, "confirm that 4 is bad before proceeding"
> is a moot point.
>
> However, you can say "git bisect bad <rev>" (and "git bisect good
> <rev>" for that matter) on a rev that is unrelated to what the
> current bisection state is.  E.g. after you mark the child of 8 as
> "bad", the bisected graph would become
>
>    G...1---2---3---4---6---8---B
>
> and you would be offered to test somewhere in the middle, say, 4.
> But it is perfectly OK for you to respond with "git bisect bad 7",
> if you know 7 is bad.
>
> I _think_ the current code blindly overwrites the "bad" pointer,
> making the bisection state into this graph if you do so.
>
>    G...1---2---3---4
>                     \
>                      5---B
Yes, we keep only one "bad" pointer.
> This is very suboptimal.  The side branch 4-to-7 could be much
> longer than the original trunk 4-to-the-tip, in which case we would
> have made the suspect space _larger_, not smaller.

Yes, but the user is supposed to not change the "bad" pointer for no good reason. For example maybe a mistake was made and the first commit marked as "bad" was not actually bad.

Show 5 quoted lines
> We certainly should be able to take advantage of the fact that the
> current "bad" commit (i.e. the child of 8) and the newly given "bad"
> commit (i.e. 7) are both known to be bad and mark 4 as "bad" instead
> when that happens, instead of doing the suboptimal thing the code
> currently does.

Yeah, we could do that, but we would have to allow it only if a special option is passed on the command line, for example:

git bisect bad --alternate <commitish>
and/or we could make "git bisect bad" accept any number of bad commitishs.

That could give additional bonus points to the GSoC student who would implement it :-)

Thanks, Christian.

Previous: Junio C HamanoNext: Junio C Hamano
Message 23 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.