git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] disallow providing multiple upstream branches to rebase, pull --rebase

From
Jay Soffian <jaysoffian@gmail.com>
Date
Feb 18, 2009, 13:32 UTC
Message-ID
<76718490902180532l1de135ccyd4e58c713e6af2c@mail.gmail.com>
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:

Show 21 quoted lines
>> 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.
Previous: Johannes SchindelinNext: Johannes Schindelin
Message 5 of 6 in “disallow providing multiple upstream branches to rebase, pull --rebase”
  1. disallow providing multiple upstream branches to rebase, pull --rebaseJay Soffian, Feb 18, 2009
  2. Johannes SchindelinFeb 18, 2009
  3. Jay SoffianFeb 18, 2009
  4. Johannes SchindelinFeb 18, 2009
  5. Jay SoffianFeb 18, 2009
  6. Johannes SchindelinFeb 18, 2009

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.