git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [BUG] git symbolic-ref does not recognize @ as the shortcut for HEAD

From
Duy Nguyen <pclouds@gmail.com>
Date
Jan 15, 2014, 11:26 UTC
Message-ID
<CACsJy8Dy5xgF5m6BOo1cfdzg5dOx58sZo0aa_YKdnyAvJ6g4=Q@mail.gmail.com>
In-Reply-To
<CAOBEgJjmoXEDVa4L5LbAGMYR7_+NCf2tDSveieZxtU4bfWyzDw@mail.gmail.com>
On Thu, Jan 9, 2014 at 10:05 PM, Mathieu Lemoine <mathieu@mlemoine.name> wrote:
Show 10 quoted lines
> Hello,
>
> In https://raw.github.com/git/git/master/Documentation/RelNotes/1.8.5.txt
> is mentioned:
>
>  * Instead of typing four capital letters "HEAD", you can say "@" now,
> e.g. "git log @".
>
> However, `git symbolic-ref @`  gives "fatal: No such ref: @", while
> `git symbolic-ref @`  gives "refs/heads/master".
you meant "while `git symbolic-ref _HEAD_` gives refs/heads/master"?
Show 5 quoted lines
> I looked around in the archive and #git, but nobody seemed to be aware
> of the behaviour.
>
> I wonder if it's on purpose given the low level of symbolic-ref or if
> it's a bug.

I think this is because symbolic-ref (and show-ref) takes plain refs, either in full or short form, but nothing else fancier. I'm not sure if we should add support for @ (and maybe @{u} as it's in the same boat) to these commands. If it's confusing and hard to explain in documents then maybe we should.

-- 
Duy
Previous: John Keeping
Message 6 of 6 in “[BUG] git symbolic-ref does not recognize @ as the shortcut for HEAD”
  1. Mathieu LemoineJan 9, 2014
  2. [BUG] "git rebase": fatal: Not a valid object name: ''Andreas Krey, Jan 9, 2014
  3. John KeepingJan 9, 2014
  4. Andreas KreyJan 9, 2014
  5. rebase: fix fork-point with zero argumentsJohn Keeping, Jan 9, 2014
  6. Duy NguyenJan 15, 2014

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.