git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Christian Couder <chriscool@tuxfamily.org>
To: Jon Seymour <jon.seymour@gmail.com>
Cc: git@vger.kernel.org, gitster@pobox.com, j6t@kdbg.org,
	jnareb@gmail.com, jrnieder@gmail.com
Subject: Re: [PATCH v17 1/7] bisect: move argument parsing before state modification.
Date: Wed, 7 Sep 2011 08:16:15 +0200	[thread overview]
Message-ID: <201109070816.16655.chriscool@tuxfamily.org> (raw)
In-Reply-To: <1312459263-16911-2-git-send-email-jon.seymour@gmail.com>

Hi,

On Thursday 04 August 2011 14:00:57 Jon Seymour wrote:
> Currently 'git bisect start' modifies some state prior to checking
> that its arguments are valid.
> 
> This change moves argument validation before state modification
> with the effect that state modification does not occur
> unless argument validations succeeds.

This thread:

http://thread.gmane.org/gmane.comp.version-control.git/180733/

made me wonder if we introduced a bug with this patch.

If we start bisecting like this:

$ git bisect start HEAD HEAD~20

and then we decide that it was not optimum and we want to start again like 
this:

$ git bisect start HEAD HEAD~6

then issuing the latter command might not work as it did before this patch.
 
Before this patch the latter command would do a "git checkout $start_head" 
before the repeated rev=$(git rev-parse -q --verify "$arg^{commit}") to 
convert arguments into sha1. And after this patch the order is reversed.

This means that before this patch "HEAD" in the arguments to "git bisect 
start" would refer to $start_head because the "git checkout $start_head" 
changes HEAD. After this patch "HEAD" in the arguments to "git bisect start" 
would refer to the current HEAD.

For example before this patch, if I issue "git bisect start HEAD HEAD~8" twice 
I get:

$ git bisect start HEAD HEAD~8
Bisecting: 15 revisions left to test after this (roughly 4 steps)
[67c116bb26b4ee31889e5ee15d6a9d3b7e972b7b] Merge branch 'jk/pager-with-
external-command'
$ git bisect start HEAD HEAD~8
Previous HEAD position was 67c116b... Merge branch 'jk/pager-with-external-
command'
Switched to branch 'master'
Bisecting: 15 revisions left to test after this (roughly 4 steps)
[67c116bb26b4ee31889e5ee15d6a9d3b7e972b7b] Merge branch 'jk/pager-with-
external-command'

so the same commit to test is checked out.

After this patch I get:

$ git bisect start HEAD HEAD~8
Bisecting: 15 revisions left to test after this (roughly 4 steps)
[67c116bb26b4ee31889e5ee15d6a9d3b7e972b7b] Merge branch 'jk/pager-with-
external-command'
$ git bisect start HEAD HEAD~8
Previous HEAD position was 67c116b... Merge branch 'jk/pager-with-external-
command'
Switched to branch 'master'
Bisecting: 15 revisions left to test after this (roughly 4 steps)
[e5cfcb04e0acc5f3b51e6d69487028315b33e4c9] Merge branch 'mh/attr'

so a different commit is checked out after the second "git bisect start HEAD 
HEAD~8".

Best regards,
Christian.

  reply	other threads:[~2011-09-07  6:16 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-08-04 12:00 [PATCH v17 0/7] bisect: Add support for --no-checkout option Jon Seymour
2011-08-04 12:00 ` [PATCH v17 1/7] bisect: move argument parsing before state modification Jon Seymour
2011-09-07  6:16   ` Christian Couder [this message]
2011-09-07 11:29     ` Junio C Hamano
2011-09-07 18:07     ` Johannes Sixt
2011-09-08  1:23       ` Jon Seymour
2011-08-04 12:00 ` [PATCH v17 2/7] bisect: use && to connect statements that are deferred with eval Jon Seymour
2011-08-04 12:00 ` [PATCH v17 3/7] bisect: add tests to document expected behaviour in presence of broken trees Jon Seymour
2011-08-04 12:01 ` [PATCH v17 4/7] bisect: introduce support for --no-checkout option Jon Seymour
2011-08-04 12:01 ` [PATCH v17 5/7] bisect: introduce --no-checkout support into porcelain Jon Seymour
2011-08-04 12:01 ` [PATCH v17 6/7] bisect: add tests for the --no-checkout option Jon Seymour
2011-08-04 12:01 ` [PATCH v17 7/7] bisect: add documentation for " Jon Seymour

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=201109070816.16655.chriscool@tuxfamily.org \
    --to=chriscool@tuxfamily.org \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=j6t@kdbg.org \
    --cc=jnareb@gmail.com \
    --cc=jon.seymour@gmail.com \
    --cc=jrnieder@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).