Re: [PATCH v2 7/7] bisect: allows any terms set by user
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Jun 11, 2015, 14:57 UTC
- Message-ID
- <xmqqa8w6gumu.fsf@gitster.dls.corp.google.com>
- In-Reply-To
- <vpqk2vaoa2t.fsf@anie.imag.fr>
Matthieu Moy <Matthieu.Moy@grenoble-inp.fr> writes:
Show 32 quoted lines
> Junio C Hamano <gitster@pobox.com> writes:
>
>> Junio C Hamano <gitster@pobox.com> writes:
>>
>>> +bisect_terms () {
>>> + test $# -eq 2 ||
>>> + die "You need to give me at least two arguments"
>>> +
>>> + if ! test -s "$GIT_DIR/BISECT_START"
>>> + then
>>> + echo $1 >"$GIT_DIR/BISECT_TERMS" &&
>>> + echo $2 >>"$GIT_DIR/BISECT_TERMS" &&
>>> + echo "1" > "$GIT_DIR/TERMS_DEFINED"
>>> + else
>>> + die "A bisection has already started, please use "\
>>> + "'git bisect reset' to restart and change the terms"
>>> + fi
>>> +}
>>> +
>>
>> I think "git bisect terms" is a good way to help a user to recall
>> what two names s/he decided to use for the current session. So
>> dying 'already started' with suggestion for 'reset' is OK, but at
>> the same time, helping the user to continue the current bisection by
>> giving a message along the lines of "You are hunting for a commit
>> that is at the boundary of the old state (you are calling it
>> '$NAME_OLD') and the new state ('$NAME_NEW')" would be a good idea.
>
> I'd put a very verbose message explaining the situation and the way out
> (use 'git bisect') for the second "die", and I would consider "git
> bisect terms" without arguments as a valid command to ask "please tell
> me what the terms are".Of course you are right. The "remind me what I was doing" help should be given when the user asks "git bisect terms" without any parameters, not in "else die" part.
Thanks for a correction.