Re: Notation for current branch?

2016-09-01 Thread ryenus
> Jacob Keller writes: > "git symbolic-ref" seems like the right thing if you need to obtain > the current branch name, and there's no reason to not just use HEAD > there. Really? Any reason why `git rev-parse --abbrev-ref '@{-1}'` works, but not `git symbolic-ref

Re: Notation for current branch?

2016-08-30 Thread Junio C Hamano
ryenus writes: > For now the best use case I can think of is with git-reflog, e.g., > the meaning of `git reflog HEAD` and `git reflog feature-branch` > are quite different, even if I'm currently on the feature-branch, > especially when I want to track the rebase histories (if

Re: Notation for current branch?

2016-08-30 Thread ryenus
e.g., the meaning of `git reflog HEAD` and `git reflog feature-branch` are quite different, even if I'm currently on the feature-branch, especially when I want to track the rebase histories (if any). If there's a notation for the current branch then I don't have to find the name of the current branch, th

Re: Notation for current branch?

2016-08-29 Thread Jacob Keller
On Mon, Aug 29, 2016 at 12:49 PM, Junio C Hamano wrote: > Jacob Keller writes: > >>> What's wrong with simply using 'HEAD' for scripting? >> >> When you want to display the current branch to the user, e.g. when >> scripting a shell prompt or similar use

Re: Notation for current branch?

2016-08-29 Thread Junio C Hamano
Jacob Keller writes: >> What's wrong with simply using 'HEAD' for scripting? > > When you want to display the current branch to the user, e.g. when > scripting a shell prompt or similar use Wait. Even if a hypothetical version of Git understood @@ as "the current

Re: Notation for current branch?

2016-08-29 Thread Jacob Keller
On Sun, Aug 28, 2016 at 6:56 AM, Jakub Narębski wrote: > W dniu 28.08.2016 o 12:51, Kevin Daudt pisze: >> On Sun, Aug 28, 2016 at 05:58:18PM +0800, ryenus wrote: > >>> I wonder if there's an easy to use notation to refer to the current branch? >>> which is expected be friendly

Re: Notation for current branch?

2016-08-28 Thread Jakub Narębski
W dniu 28.08.2016 o 12:51, Kevin Daudt pisze: > On Sun, Aug 28, 2016 at 05:58:18PM +0800, ryenus wrote: >> I wonder if there's an easy to use notation to refer to the current branch? >> which is expected be friendly to scripting. >> >> For HEAD, there's @, which is short and concise. What's

Re: Notation for current branch?

2016-08-28 Thread Kevin Daudt
On Sun, Aug 28, 2016 at 05:58:18PM +0800, ryenus wrote: > I wonder if there's an easy to use notation to refer to the current branch? > which is expected be friendly to scripting. > > For HEAD, there's @, which is short and concise. > > But for the current branch, it seems one has to either use

Notation for current branch?

2016-08-28 Thread ryenus
I wonder if there's an easy to use notation to refer to the current branch? which is expected be friendly to scripting. For HEAD, there's @, which is short and concise. But for the current branch, it seems one has to either use a not so friendly plumbing command, or grep/parse the output of `git