From: Michael J Gruber <git@drmicha.warpmail.net>
To: Miles Bader <miles@gnu.org>
Cc: Jay Soffian <jaysoffian@gmail.com>, git@vger.kernel.org
Subject: Re: set-upstream for existing branch...?
Date: Thu, 17 Feb 2011 09:23:29 +0100 [thread overview]
Message-ID: <4D5CDB01.9070502@drmicha.warpmail.net> (raw)
In-Reply-To: <AANLkTim6HDCaeTDuEtK+3niKKoz6A3KA=m=UCr4DaY-V@mail.gmail.com>
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
git name-rev @{u}
or similar with "describe", but that's really backwards - it first
expands @{u} to a refname, then to a SHA1, and then tries to describe
that SHA1 by a refname...
BTW: Please don't change "--set-upstream" light-heartedly and isolated
from other stuff. We need more consistency wrt. subcommands vs. options
vs. options taking parameters. So an incompatible change should be part
of a bigger picture. This requires some research about our current
usage, pitfalls, and the best way forward (breaking as little as
possible and achieving as much as possible).
Michael
next prev parent reply other threads:[~2011-02-17 8:26 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 [this message]
2011-02-17 9:25 ` knittl
2011-02-17 9:41 ` 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=4D5CDB01.9070502@drmicha.warpmail.net \
--to=git@drmicha.warpmail.net \
--cc=git@vger.kernel.org \
--cc=jaysoffian@gmail.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).