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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

On Wed, 18 Feb 2009, Jay Soffian wrote:

> On Wed, Feb 18, 2009 at 5:18 AM, Johannes Schindelin
> <Johannes.Schindelin@xxxxxx> wrote:
> >> diff --git a/git-rebase.sh b/git-rebase.sh
> >> index 5d9a393..ffb6027 100755
> >> --- a/git-rebase.sh
> >> +++ b/git-rebase.sh
> >> @@ -319,6 +319,7 @@ do
> >>       esac
> >>       shift
> >>  done
> >> +test $# -gt 1 && usage
> >
> > Did you just break
> >
> >        $ git rebase $UPSTREAM $BRANCH_TO_SWITCH_TO
> 
> Crap, I missed that usage somehow (and I guess the test suite doesn't
> rely on it either...). I think moving the "test $# -gt 1 && usage"
> below:
> 
> 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.

(Note: I am writing all this from memory, it could be slightly different, 
but the essence is still valid.)

Ciao,
Dscho

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux