Re: set-upstream for existing branch...?

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

 



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