Re: [PATCH v17 1/7] bisect: move argument parsing before state modification.
- From
Johannes Sixt <j6t@kdbg.org>
- Date
- Sep 7, 2011, 18:07 UTC
- Message-ID
- <4E67B2F2.9070806@kdbg.org>
- In-Reply-To
- <201109070816.16655.chriscool@tuxfamily.org>
Am 07.09.2011 08:16, schrieb Christian Couder:
Show 19 quoted lines
> 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.But isn't this an improvement? HEAD denotes the current head. After the first 'bisect start HEAD HEAD~20', HEAD is somewhere in the middle, not the original HEAD anymore; I would *expect* that a different commit is checked out if I just repeat the command.
IOW, I think the new behavior is *much* better than the old behavior.
-- Hannes