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

Re: Another use of "@"?

From
Ramkumar Ramachandra <artagnon@gmail.com>
Date
May 4, 2013, 12:44 UTC
Message-ID
<CALkWK0=qdGcbQDz2VomhOcy7AybXj5jkxzS53jFGyjdZ9+6juQ@mail.gmail.com>
In-Reply-To
<CACsJy8AcWV8hmbhG27dw+GdnZf8NnQEctYmowqd3sSzOOHf+xg@mail.gmail.com>
[joining the discussion late; was travelling]
Duy Nguyen wrote:
> git co long-branch-name
> git diff A/@
> git reset --hard A/@

In this form, this looks highly inconsistent. You have to decide if you want @ to resolve to the current branch name or HEAD. Our current @-proposal makes @@{1} display the reflog for HEAD for instance. The other problem is that we resolve things like @{-1} to full refs like refs/heads/master. Making a A/@{-1} work makes little or no sense, because that refs/heads needs to be changed to refs/remotes in the first place. What about refs/decapitated/@{-1}? Should we support it?

I tend to agree with Junio here: @{u} is the way forward. We need to define useful reduced consistent semantics; while inventing a mini-language to do all kinds of revision manipulations may be a fun theoretical exercise, it's too much effort for too little gain. We have to learn to work within the limitations of what we've invented so far.

On Matthieu's note, I have a comment: symbolic refs are an absolute dead end. We didn't think of it from the start, and it's too late now. Do NOT go there: from my investigation, I believe that hooking up everything to the revision parser is the way forward.

Previous: Felipe ContrerasNext: Matthieu Moy
Message 10 of 11 in “Another use of "@"?”
  1. Duy NguyenMay 3, 2013
  2. Junio C HamanoMay 3, 2013
  3. Junio C HamanoMay 3, 2013
  4. Duy NguyenMay 3, 2013
  5. Thomas RastMay 3, 2013
  6. Matthieu MoyMay 3, 2013
  7. Duy NguyenMay 4, 2013
  8. Duy NguyenMay 4, 2013
  9. Felipe ContrerasMay 3, 2013
  10. Ramkumar RamachandraMay 4, 2013
  11. Matthieu MoyMay 4, 2013

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.