From: Jens Lehmann <Jens.Lehmann@web.de>
To: "W. Trevor King" <wking@tremily.us>
Cc: Jeff King <peff@peff.net>, szager@google.com, git@vger.kernel.org
Subject: Re: [PATCH] Fixes handling of --reference argument.
Date: Thu, 25 Oct 2012 23:32:29 +0200 [thread overview]
Message-ID: <5089AFED.7060404@web.de> (raw)
In-Reply-To: <20121025104519.GA3816@odin.tremily.us>
Am 25.10.2012 12:45, schrieb W. Trevor King:
> On Thu, Oct 25, 2012 at 04:36:26AM -0400, Jeff King wrote:
>> On Wed, Oct 24, 2012 at 09:52:52PM -0700, szager@google.com wrote:
>>> diff --git a/git-submodule.sh b/git-submodule.sh
>>> index ab6b110..dcceb43 100755
>>> --- a/git-submodule.sh
>>> +++ b/git-submodule.sh
>>> @@ -270,7 +270,6 @@ cmd_add()
>>> ;;
>>> --reference=*)
>>> reference="$1"
>>> - shift
>>> ;;
>>
>> Is that right? We'll unconditionally do a "shift" at the end of the
>> loop. If it were a two-part argument like "--reference foo", the extra
>> shift would make sense, but for "--reference=*", no extra shift should
>> be neccessary. Am I missing something?
>
> Both the patch and Jeff's analysis are right. You only need an
> in-case shift if you consume "$2", or you're on ‘--’ and you're
> breaking before the end-of-case shift.
Right you are. The shift there is wrong, as there is no extra argument
to consume for "--reference=<repo>" (opposed to "--reference <repo>",
also see cmd_update() where this is done right).
So tested and Acked-By me, but me thinks the subject should read:
[PATCH] submodule add: Fix handling of the --reference=<repo> option
and the commit message should begin with:
Doing a shift there is wrong because there is no extra argument
to consume when "--reference=<repo>" is used (note the '=' instead
of a space).
Peff, is it ok for you to squash that in or do you want Stefan to resend?
next prev parent reply other threads:[~2012-10-25 21:32 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-10-25 4:52 [PATCH] Fixes handling of --reference argument szager
2012-10-25 8:36 ` Jeff King
2012-10-25 10:45 ` W. Trevor King
2012-10-25 21:32 ` Jens Lehmann [this message]
2012-10-26 0:39 ` Jeff King
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=5089AFED.7060404@web.de \
--to=jens.lehmann@web.de \
--cc=git@vger.kernel.org \
--cc=peff@peff.net \
--cc=szager@google.com \
--cc=wking@tremily.us \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.