From: Jay Soffian <jaysoffian@gmail.com>
To: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Cc: git@vger.kernel.org, Junio C Hamano <gitster@pobox.com>
Subject: Re: [PATCH] disallow providing multiple upstream branches to rebase, pull --rebase
Date: Wed, 18 Feb 2009 08:32:43 -0500 [thread overview]
Message-ID: <76718490902180532l1de135ccyd4e58c713e6af2c@mail.gmail.com> (raw)
In-Reply-To: <alpine.DEB.1.00.0902181427030.6274@intel-tinevez-2-302>
On Wed, Feb 18, 2009 at 8:28 AM, Johannes Schindelin
<Johannes.Schindelin@gmx.de> wrote:
>> if test -z "$rebase_root"
>> then
>> # The upstream head must be given. Make sure it is valid.
>> upstream_name="$1"
>> shift
>> upstream=`git rev-parse --verify "${upstream_name}^0"` ||
>> die "invalid upstream $upstream_name"
>> unset root_flag
>> upstream_arg="$upstream_name"
>> else
>> test -z "$newbase" && die "--root must be used with --onto"
>> unset upstream_name
>> unset upstream
>> root_flag="--root"
>> upstream_arg="$root_flag"
>> fi
>>
>> will do the trick, yes?
>
> Nope. Note the "shift" in the first arm? It is so that the code below
> can check for $#, and it indeed does, in a 'case' statement.
The case statement checks $# against 1 and *, not 1 and 0. And I don't
see how > 1 is valid at that point. So I can modify the case statement
to check against 1, 0, and have * emit usage, or I think moving the
"test $# -gt 1 && usage" to where I suggested in the last message
would do the trick. The only difference would be whether a pre-rebase
hook runs in the case of invalid arguments (the case statement is
after that hook runs).
j.
next prev parent reply other threads:[~2009-02-18 13:34 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-02-18 4:44 [PATCH] disallow providing multiple upstream branches to rebase, pull --rebase Jay Soffian
2009-02-18 10:18 ` Johannes Schindelin
2009-02-18 13:23 ` Jay Soffian
2009-02-18 13:28 ` Johannes Schindelin
2009-02-18 13:32 ` Jay Soffian [this message]
2009-02-18 13:36 ` Johannes Schindelin
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=76718490902180532l1de135ccyd4e58c713e6af2c@mail.gmail.com \
--to=jaysoffian@gmail.com \
--cc=Johannes.Schindelin@gmx.de \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).