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

Re: [PATCH v15 7/7] bisect: add documentation for --no-checkout option.

From
Jon Seymour <jon.seymour@gmail.com>
Date
Aug 3, 2011, 21:37 UTC
Message-ID
<CAH3Anrq_xAUDN5UW6XB+VvGbCB3OrM0WdKRUKTAufVx5xCa+MA@mail.gmail.com>
In-Reply-To
<7v62meb4a3.fsf@alter.siamese.dyndns.org>
On Thu, Aug 4, 2011 at 6:59 AM, Junio C Hamano <gitster@pobox.com> wrote:
Show 30 quoted lines
> Jon Seymour <jon.seymour@gmail.com> writes:
>
>> +This option is useful in circumstances in which checkout is either not
>> +possible (because the repository is damaged) or is otherwise not required.
>
> I do not think "because the repository is damaged" is a particularly good
> example to single out here. For one thing, you may not be able to bisect
> the history in a damaged repository due to unreadable commits. There are
> other valid and more plausible reasons that the users do not want to
> update the working tree while bisecting, e.g. they have local changes,
> they do not want to rebuild everything after bisection is done, etc.
>
> Also the above description muddies what is prerequisite and what is user's
> wish.
>
>  - "is otherwise not required" is the prerequisite: "if and only if the
>   test you would perform during bisection does not need a checkout of the
>   version being tested, you can use this option";
>
>  - Even if the user wishes to use this option for various reasons (e.g. so
>   that the next "make" wouldn't have to rebuild everything unnecessarily;
>   or the repository has corrupt blobs and checkout of some versions may
>   fail), if the test _needs_ a checkout, it is not an option to use this
>   feature.
>
> So I would suggest toning it down perhaps like this:
>
>    This option may be useful when the test you would perform in each step
>    does not require a checked out tree.
>
Sounds good.
Show 28 quoted lines
>> +$ git bisect run eval '
>> +rc=1;
>> +if git rev-list --objects BISECT_HEAD >tmp.$$; then
>> +   git pack-objects --stdout >/dev/null < tmp.$$ && rc=0;
>> +fi;
>> +rm tmp.$$;
>> +test $rc -eq 0;'
>
> Hmm, "eval"?
>
> More importantly, aren't these excessive and unnecessary semicolons
> unsightly?
>
>        $ git bisect run sh -c '
>                git rev-list --objects BISECT_HEAD >tmp.$$ &&
>                git pack-objects --stdout >/dev/null <tmp.$$
>                rc=$?
>                rm -f tmp.$$
>                test $rc = 0'
>
>> +In this case, when 'git bisect run' finishes, bisect/bad will refer to a commit that
>> +has at least one parent whose reachable graph is fully traversable in the sense
>> +required by 'git pack objects'.
>
> Also "everything reachable from BISECT_HEAD" feels unnecessarily
> wasteful. By the time you invoke "bisect run", you already know one good
> commit, everything reachable from which are known to be good.
>
How about?
git bisect run sh -c '
        GOOD=$(git for-each-ref "--format=%(objectname)" refs/bisect/good-*) &&
        git rev-list --objects BISECT_HEAD --not $GOOD >tmp.$$ &&
        git pack-objects --stdout >/dev/null <tmp.$$
        rc=$?
        rm -f tmp.$$
        test $rc = 0'
Previous: Junio C Hamano
Message 12 of 12 in “bisect: Add support for --no-checkout option”
  1. 0/7 bisect: Add support for --no-checkout optionJon Seymour, Aug 3, 2011
  2. 1/7 bisect: move argument parsing before state modification.Jon Seymour, Aug 3, 2011
  3. 2/7 bisect: use && to connect statements that are deferred with eval.Jon Seymour, Aug 3, 2011
  4. 3/7 bisect: add tests to document expected behaviour in presence of broken trees.Jon Seymour, Aug 3, 2011
  5. 4/7 bisect: introduce support for --no-checkout option.Jon Seymour, Aug 3, 2011
  6. 5/7 bisect: introduce --no-checkout support into porcelain.Jon Seymour, Aug 3, 2011
  7. Jon SeymourAug 3, 2011
  8. Christian CouderAug 3, 2011
  9. 6/7 bisect: add tests for the --no-checkout option.Jon Seymour, Aug 3, 2011
  10. 7/7 bisect: add documentation for --no-checkout option.Jon Seymour, Aug 3, 2011
  11. Junio C HamanoAug 3, 2011
  12. Jon SeymourAug 3, 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.