git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Michael J Gruber <git@drmicha.warpmail.net>
To: knittl <knittl89@googlemail.com>
Cc: Miles Bader <miles@gnu.org>, Jay Soffian <jaysoffian@gmail.com>,
	git@vger.kernel.org
Subject: Re: set-upstream for existing branch...?
Date: Thu, 17 Feb 2011 10:41:06 +0100	[thread overview]
Message-ID: <4D5CED32.3030507@drmicha.warpmail.net> (raw)
In-Reply-To: <AANLkTimPYkEczv=suCr02rVb3OSg_h9o88_5CEmonPTR@mail.gmail.com>

knittl venit, vidit, dixit 17.02.2011 10:25:
> On Thu, Feb 17, 2011 at 9:23 AM, Michael J Gruber
> <git@drmicha.warpmail.net> wrote:
>> Miles Bader venit, vidit, dixit 17.02.2011 08:24:
>>> Hmm, on a related note, is there an obvious way to _show_ the current
>>> branch's upstream...?
>>>
>>> [I mean, which just prints out "origin/master" or whatever...]
>>>
>>> Thanks,
>>>
>>> -miles
>>>
>>
>> git for-each-ref --format="%(upstream)" $(git symbolic-ref HEAD)
>>
>> I can't come up with a better way of expanding @{u} without resolving
>> the resulting refname to a SHA1. You could do
> 
> what about
> 
>     git branch -vv
> 
> it will show all local branches with their upstream plus behind/ahead numbers

That's a very nice and useful output, but my impression was that Miles
was more interested in one branch (the current one), and I think Jay
gave the most direct solution. While it does go through the
resolve-describe-circle (compared to for-each-ref) it should still be
efficient.

Michael

      reply	other threads:[~2011-02-17  9:44 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-02-17  5:19 set-upstream for existing branch...? Miles Bader
2011-02-17  7:08 ` Jay Soffian
2011-02-17  7:11   ` Miles Bader
2011-02-17  7:24     ` Miles Bader
2011-02-17  7:45       ` Jay Soffian
2011-02-17  8:23       ` Michael J Gruber
2011-02-17  9:25         ` knittl
2011-02-17  9:41           ` Michael J Gruber [this message]

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=4D5CED32.3030507@drmicha.warpmail.net \
    --to=git@drmicha.warpmail.net \
    --cc=git@vger.kernel.org \
    --cc=jaysoffian@gmail.com \
    --cc=knittl89@googlemail.com \
    --cc=miles@gnu.org \
    /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).