From: Thomas Rast <trast@inf•ethz.ch>
To: Junio C Hamano <gitster@pobox•com>
Cc: <git@vger•kernel.org>
Subject: Re: [PATCH 1/3] remote: add a test for extra arguments, according to docs
Date: Thu, 25 Apr 2013 09:23:34 +0200 [thread overview]
Message-ID: <87obd3cbux.fsf@linux-k42r.v.cablecom.net> (raw)
In-Reply-To: <7vhaiva9u5.fsf@alter.siamese.dyndns.org> (Junio C. Hamano's message of "Wed, 24 Apr 2013 14:37:54 -0700")
Junio C Hamano <gitster@pobox•com> writes:
> Thomas Rast <trast@inf•ethz.ch> writes:
>
>> +test_extra_arg () {
>> + expect="success"
>> + if test "z$1" = "z-f"; then
>> + expect=failure
>> + shift
>> + fi
>> + test_expect_$expect "extra args: $*" "
>> + test_must_fail git remote $* bogus_extra_arg 2>actual &&
>> + grep '^usage:' actual
>> + "
>> +}
>> +
>> +test_extra_arg -f add nick url
>> +test_extra_arg rename origin newname
>
> Perhaps just a taste in readability thing, but I would prefer to see
> them more like
>
> test_extra_arg_expect failure add nick url
> test_extra_arg_expect success rename origin newname
>
> than misunderstanding-inviting "-f" that often stands for "--force".
Hmm. I had that at first, but then the final cleanup would have had to
touch all tests to remove the optional argument, making it noisy.
Anyway, it's probably all a bit over-engineered for only one effective
code change ;-)
--
Thomas Rast
trast@{inf,student}.ethz.ch
next prev parent reply other threads:[~2013-04-25 7:23 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-04-24 13:54 [PATCH 0/3] git remote with superfluous arguments Thomas Rast
2013-04-24 13:54 ` [PATCH 1/3] remote: add a test for extra arguments, according to docs Thomas Rast
2013-04-24 21:37 ` Junio C Hamano
2013-04-25 7:23 ` Thomas Rast [this message]
2013-04-25 15:31 ` Junio C Hamano
2013-04-24 13:54 ` [PATCH 2/3] remote: check for superfluous arguments in 'git remote add' Thomas Rast
2013-04-24 13:54 ` [PATCH 3/3] remote: 'show' and 'prune' take more than one remote Thomas Rast
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=87obd3cbux.fsf@linux-k42r.v.cablecom.net \
--to=trast@inf$(echo .)ethz.ch \
--cc=git@vger$(echo .)kernel.org \
--cc=gitster@pobox$(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