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
Jon Seymour <jon.seymour@gmail.com>
Date
Jul 24, 2011, 08:54 UTC
Message-ID
<CAH3Anrp7h+TkGgi1uZsfZKWkK3zDYa=eG2kjHRcmoPKvkZq59w@mail.gmail.com>
In-Reply-To
<4E2BD251.6060306@kdbg.org>
On Sun, Jul 24, 2011 at 6:05 PM, Johannes Sixt <j6t@kdbg.org> wrote:
Show 7 quoted lines
> Am 24.07.2011 07:57, schrieb Jon Seymour:
>> Currently git bisect assumes that the respository to be undamaged. This limits the usefulness
>> of git bisect when working with damaged repositories.
>
> So, what? Isn't a broken repository also (almost) useless w.r.t. log,
> checkout, rebase, reset, push, fetch...?
>

The broken or missing commits in a broken repository are useless, but all the other commits and the things they reach may still be useful.

When trying to recover such things, git bisect could be a useful tool, since it would allow one to automate discovery of the broken regions of the graph. Once the broken regions have been isolated, grafts can be used to cauterize the damaged regions, the remainder can be rescued with git-filter-branch and life goes on.

Show 10 quoted lines
>> This series introduces an option, --ignore-checkout-failure, which can be used with
>> "git bisect start" to indicate that checkout failures should be tolerated for the life
>> of the (new) bisection process. This allows git bisect to be used on damaged repositories. In
>> particular, it allows git bisect to be used to locate commits containing damaged trees.
>
> I have to wonder: why do you care only about git-bisect? If you want to
> be able to use a broken repository, aren't there many more commands that
> fail and for which you also want to have a similar work-around? Or is
> git-bisect the only one where the work-around was missing?
>

git bisect is, in principle, a very useful tool for identifying regions of damage in a broken repo.

I don't want to have to write another tool that does exactly what git bisect does except for the checkout function which, for the purpose of repo rescue, I do not need.

Show 5 quoted lines
>
> But what is an inconsistent state good for? In general, it makes no
> sense to decide whether the result is "good" or "bad" when you know in
> advance that the checked-out state is inconsistent.
>

The inconsistent state is useful because I can use that state to progress the bisection. In particular, I can write a test which checks to see whether this particular commit is broken (can't reach its parents or its tree). In fact, git status does just nicely for this purpose.

And by using that test with git bisect I can discover the precise boundaries of the broken regions of the graph.

Of course, I have no intention of doing any kind of development with a repo in that state - the point is to only to make an existing tool even more useful - by helping it deal with broken repos too.

jon.
Previous: Johannes SixtNext: Junio C Hamano
Message 12 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.