git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jay Soffian <jaysoffian@gmail.com>
To: Jeff King <peff@peff.net>
Cc: Marc Branchaud <marcnarc@xiplink.com>,
	Miles Bader <miles@gnu.org>,
	git@vger.kernel.org
Subject: Re: setting up tracking on push
Date: Tue, 10 Mar 2009 22:59:01 -0400	[thread overview]
Message-ID: <76718490903101959i61df26aagdff44bb9ab4593ab@mail.gmail.com> (raw)
In-Reply-To: <20090311020409.GA31365@coredump.intra.peff.net>

On Tue, Mar 10, 2009 at 10:04 PM, Jeff King <peff@peff.net> wrote:
>
>> -u --track [<branch>] <upstream>
>
> Hmm. This seems not quite right to me. Specifically:
>
>  1. Would you ever want to use "-u" without "--track"? If so, then why
>     are they two separate options?

For when branch grows additional long options that update, er,
something else. :-)

And you can also use it with --no-track.

But the primary reason for the -u is to differentiate the operation,
just like -m and -d.

>  2. In your example, if I give only a single non-option argument, it is
>     interpreted as the upstream (and presumably the branch defaults to
>     HEAD).  But in other branch commands, it is interpreted as the
>     branch, and the upstream defaults to HEAD.

No, look at how -m works. [<oldbranch>] <newbranch>. I modeled it after that.

> For (1), you could just have a single option. Unfortunately --track is
> taken. But maybe you could do --track=. And that helps with (2), as
> well, since this syntax would only ever have one or zero arguments. And
> then you can default zero to HEAD.
>
> IOW:
>
>  # track origin/master with the current branch
>  git branch --track=origin/master
>
>  # track origin/master with a different branch
>  git branch --track=origin/master other_branch
>
>  # stop tracking
>  git branch --track=
>
> The only two problems I can think of are:
>
>  1. It is perhaps a little confusing that --track= means "don't do the
>     normal branch operation, but instead do this totally different
>     thing. Of course we already have a similar situation with "-m", but
>     it is perhaps more confusing since "--track" and "--track=" have
>     totally different semantics.
>
>  2. This would be the only branch command to operate on HEAD if given
>     no argument. That isn't necessary for this proposal, but I think it
>     makes it nicer to use. An alternative would be for git-branch to
>     resolve symrefs (which would also be nice for "git branch -m HEAD
>     foo").

Yeah, I like that less than -u, which I agree isn't perfect, but I
think it's closer.

j.

  reply	other threads:[~2009-03-11  3:00 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-03-06  3:07 setting up tracking on push Miles Bader
2009-03-06  3:17 ` John Tapsell
2009-03-06  4:49 ` Jay Soffian
2009-03-06 10:45   ` Johannes Schindelin
2009-03-06 11:15     ` Miles Bader
2009-03-06 14:15       ` Jeremy O'Brien
2009-03-06 15:43         ` Jay Soffian
2009-03-06 16:29           ` Miles Bader
2009-03-10 20:26             ` Marc Branchaud
2009-03-10 23:09               ` Jeff King
2009-03-11  1:52                 ` Jay Soffian
2009-03-11  2:04                   ` Jeff King
2009-03-11  2:59                     ` Jay Soffian [this message]
2009-03-11  3:06                       ` Jeff King
2009-03-11  3:40                         ` Jay Soffian
2009-03-11  3:44                         ` Jay Soffian
2009-03-11  3:57                           ` Jeff King
2009-03-11  4:15                             ` Jay Soffian
2009-03-24  9:58                               ` Jakub Narebski
2009-03-11  4:37                     ` Junio C Hamano
2009-03-11  4:56                       ` Miles Bader
2009-03-11  5:03                         ` Miles Bader
2009-03-11  5:22                       ` Jay Soffian
2009-03-11 21:39                         ` Marc Branchaud
2009-03-11  6:32                       ` Jeff King
2009-03-11 10:02                       ` Nanako Shiraishi
2009-03-11 16:40                         ` Jeff King
2009-03-12  0:08 ` John M. Dlugosz
2009-03-12  0:58   ` Jay Soffian
2009-03-12  1:11     ` Junio C Hamano
2009-03-12  1:16       ` Jay Soffian
2009-03-12  1:14     ` Jay Soffian
2009-03-12  1:21       ` Jay Soffian
2009-03-15  3:28       ` John M. Dlugosz
2009-03-15 12:36         ` Jay Soffian
2009-03-16  1:07           ` John M. Dlugosz
2009-03-16  1:43             ` Jay Soffian
2009-03-15 18:33         ` Junio C Hamano

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=76718490903101959i61df26aagdff44bb9ab4593ab@mail.gmail.com \
    --to=jaysoffian@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=marcnarc@xiplink.com \
    --cc=miles@gnu.org \
    --cc=peff@peff.net \
    /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).