From: Matthieu Moy <Matthieu.Moy@grenoble-inp•fr>
To: Christian Couder <christian.couder@gmail•com>
Cc: Junio C Hamano <gitster@pobox•com>, git <git@vger•kernel.org>,
Antoine Delaite <antoine.delaite@ensimag•grenoble-inp.fr>,
louis--alexandre stuber
<louis--alexandre.stuber@ensimag•grenoble-inp.fr>,
Christian Couder <chriscool@tuxfamily•org>,
Thomas Nguy <thomasxnguy@gmail•com>,
Valentin Duperray <valentinduperray@gmail•com>
Subject: Re: [PATCH v10 7/7] bisect: allow any terms set by user
Date: Fri, 26 Jun 2015 22:59:48 +0200 [thread overview]
Message-ID: <vpq7fqqqj7f.fsf@anie.imag.fr> (raw)
In-Reply-To: <CAP8UFD1Donr4v3Z8bpawv0_heDUQ+-EkepZF6UvuXOed7TQBXA@mail.gmail.com> (Christian Couder's message of "Fri, 26 Jun 2015 22:29:04 +0200")
Christian Couder <christian.couder@gmail•com> writes:
> On Fri, Jun 26, 2015 at 6:58 PM, Matthieu Moy <Matthieu.Moy@imag•fr> wrote:
>> From: Antoine Delaite <antoine.delaite@ensimag•grenoble-inp.fr>
>>
>> Introduction of the git bisect terms command. The user can set his own
>> terms. It will work exactly like before. The terms must be set before the
>> start.
>
> After looking a bit at the code, I think that for now existing
> predefined terms ("bad", "good", "new" and "old") as well as some
> other terms that look like bisect subcommands like "skip", "start" and
> "terms" should be disallowed as arguments to "git bisect terms",
More importantly, subcommands should be disallowed, or the user may
completely break bisect (e.g. running 'git bisect terms reset bar'
prevents you from running 'git bisect reset' later).
And they should be different, or some more funny situation will occur.
I've just squashed this into my last patch:
diff --git a/git-bisect.sh b/git-bisect.sh
index cf07a91..f6be218 100755
--- a/git-bisect.sh
+++ b/git-bisect.sh
@@ -607,9 +607,21 @@ bisect_terms () {
gettextln "Your current terms are $NAME_GOOD for the old state
and $NAME_BAD for the new state."
else
- die "$(gettext "No terms defined.")"
+ die "$(gettext "no terms defined")"
fi ;;
2)
+ for term in "$@"
+ do
+ case "$term" in
+ help|start|bad|good|new|old|terms|skip|next|reset|visualize|replay|log|run)
+ die "$(eval_gettext "can't use the builtin command '\$term' as a term")"
+ ;;
+ esac
+ done
+ if test "$1" = "$2"
+ then
+ die "$(gettext "please use two different terms")"
+ fi
if ! test -s "$GIT_DIR/BISECT_START"
then
write_terms "$1" "$2"
diff --git a/t/t6030-bisect-porcelain.sh b/t/t6030-bisect-porcelain.sh
index eb8cc80..5a7243b 100755
--- a/t/t6030-bisect-porcelain.sh
+++ b/t/t6030-bisect-porcelain.sh
@@ -852,7 +852,7 @@ test_expect_success 'bisect terms needs 0 or 2 arguments' '
test_must_fail git bisect terms only-one &&
test_must_fail git bisect terms 1 2 3 &&
test_must_fail git bisect terms 2>actual &&
- echo "No terms defined." >expected &&
+ echo "no terms defined" >expected &&
test_cmp expected actual
'
Updated my GitHub branch, but I'll stop spamming the list with git
send-email for a while ;-).
--
Matthieu Moy
http://www-verimag.imag.fr/~moy/
prev parent reply other threads:[~2015-06-26 21:01 UTC|newest]
Thread overview: 38+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-06-26 16:58 [PATCH v10 0/7] bisect terms Matthieu Moy
2015-06-26 16:58 ` [PATCH v10 1/7] bisect: correction of typo Matthieu Moy
2015-06-26 16:58 ` [PATCH v10 2/7] Documentation/bisect: move getting help section to the end Matthieu Moy
2015-06-26 16:58 ` [PATCH v10 3/7] Documentation/bisect: revise overall content Matthieu Moy
2015-06-26 16:58 ` [PATCH v10 4/7] bisect: replace hardcoded "bad|good" by variables Matthieu Moy
2015-06-26 16:58 ` [PATCH v10 5/7] bisect: simplify the addition of new bisect terms Matthieu Moy
2015-06-26 19:22 ` Christian Couder
2015-06-26 20:32 ` [PATCH v10.1 " Matthieu Moy
2015-06-26 21:27 ` Junio C Hamano
2015-06-26 21:37 ` Matthieu Moy
2015-06-26 16:58 ` [PATCH v10 6/7] bisect: add the terms old/new Matthieu Moy
2015-06-26 16:58 ` [PATCH v10 7/7] bisect: allow any terms set by user Matthieu Moy
2015-06-26 18:16 ` Junio C Hamano
2015-06-26 20:39 ` [PATCH v10.1 " Matthieu Moy
2015-06-26 22:25 ` Junio C Hamano
2015-06-27 4:10 ` Christian Couder
2015-06-27 4:25 ` Junio C Hamano
2015-06-27 4:51 ` Christian Couder
2015-06-27 8:32 ` Matthieu Moy
2015-06-27 18:41 ` Junio C Hamano
2015-06-29 9:51 ` Matthieu Moy
2015-06-29 16:35 ` Junio C Hamano
2015-06-28 5:51 ` Michael Haggerty
2015-06-28 6:15 ` Junio C Hamano
2015-06-28 6:46 ` Michael Haggerty
2015-06-28 7:32 ` Junio C Hamano
2015-06-28 11:31 ` Michael Haggerty
2015-06-28 18:51 ` Junio C Hamano
2015-06-29 7:27 ` Matthieu Moy
2015-06-29 16:40 ` Junio C Hamano
2015-06-29 5:08 ` Christian Couder
2015-06-29 7:34 ` Matthieu Moy
2015-06-29 8:08 ` Christian Couder
2015-06-29 9:32 ` Matthieu Moy
2015-06-29 10:55 ` Christian Couder
2015-06-29 15:19 ` Matthieu Moy
2015-06-26 20:29 ` [PATCH v10 " Christian Couder
2015-06-26 20:59 ` Matthieu Moy [this message]
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=vpq7fqqqj7f.fsf@anie.imag.fr \
--to=matthieu.moy@grenoble-inp$(echo .)fr \
--cc=antoine.delaite@ensimag$(echo .)grenoble-inp.fr \
--cc=chriscool@tuxfamily$(echo .)org \
--cc=christian.couder@gmail$(echo .)com \
--cc=git@vger$(echo .)kernel.org \
--cc=gitster@pobox$(echo .)com \
--cc=louis--alexandre.stuber@ensimag$(echo .)grenoble-inp.fr \
--cc=thomasxnguy@gmail$(echo .)com \
--cc=valentinduperray@gmail$(echo .)com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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