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

Re: [RFC 0/9] bisect: allow git bisect to be used with repos containing damaged trees.

From
Junio C Hamano <gitster@pobox.com>
Date
Jul 24, 2011, 18:35 UTC
Message-ID
<7v1uxfwmq3.fsf@alter.siamese.dyndns.org>
In-Reply-To
<1311487074-25070-1-git-send-email-jon.seymour@gmail.com>
Jon Seymour <jon.seymour@gmail.com> writes:
> ... In particular, it
> allows git bisect to be used to locate commits containing damaged trees.

I am afraid it wouldn't allow it, and I am not going to take this series that adds an option to bisect to ignore errors during checkout.

Remember that bisection is to find a single event in the history whose effect consistently persists in all the commits into the future from that point. For example, if you have this history:

    ---A---B---C

and there is a bitflip in a blob contained in the commit B's tree, you may not be able to check it out. But that does _not_ mean you cannot check C out due to a corrupt object in B. The change going from B to C may be to remove that blob, for example. "A tree that refers to a corrupt object was introduced by this commit" is not a single event whose effect cascades through the history into the future [*1*].

Besides, if you have a corrupt commit, your history traversal may not even be correct, as we won't be reading its parent pointers correctly.

Having said that, an option to bisect that does _not_ touch the index nor the working tree at all may be a useful thing to have. The test you want to run on the candidate revisions bisect suggests may not need a working tree (e.g. it may be built around "git grep -e foo $revision -- $path"), and it may work just as well for the bisection you wanted to do in your broken repository.

[Footnote]

*1* Theoretically, you could turn it into such by using a test that wants to traverse and verify all the objects reachable from the candidate commit, e.g.

    $ git rev-list --objects $rev | git pack-objects --stdout >/dev/null

which would succeed on A, and fail on B and all the commits that reach B, including C. Was that what you had in mind?

Previous: Jon SeymourNext: Jon Seymour
Message 13 of 21 in “[RFC 0/9] bisect: allow git bisect to be used with repos containing damaged trees.”
  1. Jon SeymourJul 24, 2011
  2. 1/9 bisect: add tests to document expected behaviour in presence of broken trees.Jon Seymour, Jul 24, 2011
  3. 2/9 bisect: introduce a --ignore-checkout-failure option to bisect--helper.Jon Seymour, Jul 24, 2011
  4. 3/9 bisect: implement support for --ignore-checkout-failure optionJon Seymour, Jul 24, 2011
  5. 4/9 bisect: introduce a helper function to tolerate checkout failures.Jon Seymour, Jul 24, 2011
  6. 5/9 bisect: replace existing calls to git checkout with bisect_checkout_with_ignoreJon Seymour, Jul 24, 2011
  7. 6/9 bisect: enable --ignore-checkout-failure in the porcelain.Jon Seymour, Jul 24, 2011
  8. 7/9 bisect: better diagnostics, in case of mis-typed option.Jon Seymour, Jul 24, 2011
  9. 8/9 bisect: add tests for --ignore-checkout-failure option.Jon Seymour, Jul 24, 2011
  10. 9/9 bisect: add documentation for --ignore-checkout-failure option.Jon Seymour, Jul 24, 2011
  11. Johannes SixtJul 24, 2011
  12. Jon SeymourJul 24, 2011
  13. Junio C HamanoJul 24, 2011
  14. Jon SeymourJul 25, 2011
  15. Junio C HamanoJul 25, 2011
  16. Jon SeymourJul 25, 2011
  17. Johannes SixtJul 25, 2011
  18. Jon SeymourJul 25, 2011
  19. Jakub NarebskiJul 26, 2011
  20. Jon SeymourJul 26, 2011
  21. Jon SeymourJul 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.