Re: branch --set-upstream considered harmful

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

 



On Mon, Jun 7, 2010 at 1:10 AM, Tay Ray Chuan <rctay89@xxxxxxxxx> wrote:
>>  (topic)$ git branch --set-upstream origin/master
>
> Hmm, I can see where the confusion is coming from - you're treating
> git-branch as a "branch modifier", when it really is a "branch
> creator" - unless you use -f, of course.

Given --set-upstream's implementation and documentation, I assume it
is primarily intended to be used with an existing branch:

       --set-upstream
           If specified branch does not exist yet or if --force has been
           given, acts exactly like --track. Otherwise sets up configuration
           like --track would when creating the branch, except that where
           branch points to is not changed.

If it isn't, then there's no way to do what it does other than two
magical git config commands.

>>  (topic)$ git branch --set-upstream=origin/master
>>  Branch topic set up to track remote branch master from origin.
>
> I was under the impression that long-style options took "=".

Git is inconsistent. Some do, some don't. But --set-upstream is
currently an argumentless switch. If I were to proceed as I suggested,
it would be both an argumentless switch and an option which takes an
argument. That means these would be equivalent:

$ git branch --set-upstream=origin/master master
$ git branch --set-upstream master origin/master

But these WOULD NOT:

$ git branch --set-upstream=origin/master
$ git branch --set-upstream origin/master

j.
--
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]