git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jay Soffian <jaysoffian@gmail.com>
To: Tay Ray Chuan <rctay89@gmail.com>
Cc: git <git@vger.kernel.org>
Subject: Re: branch --set-upstream considered harmful
Date: Mon, 7 Jun 2010 01:19:39 -0400	[thread overview]
Message-ID: <AANLkTildT6TRd0sPlv1QbCLO7oOPHM-L1yWNIdhdp0ex@mail.gmail.com> (raw)
In-Reply-To: <AANLkTikUkkWQl7cYuPiKGaJFYL_JlIGFCXXf7En8t0FN@mail.gmail.com>

On Mon, Jun 7, 2010 at 1:10 AM, Tay Ray Chuan <rctay89@gmail.com> 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.

  reply	other threads:[~2010-06-07  5:19 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-06-06 19:21 branch --set-upstream considered harmful Jay Soffian
2010-06-07  5:10 ` Tay Ray Chuan
2010-06-07  5:19   ` Jay Soffian [this message]
2010-06-07  6:37     ` Thomas Rast
2010-06-07  7:37       ` Jay Soffian
2010-06-07  8:44 ` Michael J Gruber

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=AANLkTildT6TRd0sPlv1QbCLO7oOPHM-L1yWNIdhdp0ex@mail.gmail.com \
    --to=jaysoffian@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=rctay89@gmail.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).