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

Re: [PATCH] refs.c: interpret @ as HEAD

From
Felipe Contreras <felipe.contreras@gmail.com>
Date
Apr 30, 2013, 22:00 UTC
Message-ID
<CAMP44s1LJg9kcBVMb8YxJDTEpKerJoN5td7276=JB7ZY6APpZw@mail.gmail.com>
In-Reply-To
<CALkWK0kcuaXTKbafmC72C3H+UZN6oeEY140T21LJUHveO=UBvA@mail.gmail.com>

On Tue, Apr 30, 2013 at 1:22 PM, Ramkumar Ramachandra <artagnon@gmail.com> wrote:

Show 10 quoted lines
> Junio C Hamano wrote:
>> @{-1}@{0} does.  That means @{0} is a revision and not a ref, but @{-1}
>> is.
>
> Right.  I missed that.
>
>> '"@" given alone' has to be a ref if we want @@{5.minutes.ago} to
>> resolve.
>
> Yeah, I just realized that it's a bug in the @{u} implementation.

I don't think so. You probably need to modify branch_get(), because it has a special case for "HEAD", and who knows if it's hard-coded in other places. It's not just the @{u} implementation.

If we do the magic at the rev-parsing phase, all these details become irrelevant.

FTR. @@{upstream} and @@{now} works just fine in v2 of my patch series.
-- 
Felipe Contreras
Previous: Ramkumar Ramachandra
Message 21 of 21 in “refs.c: interpret @ as HEAD”
  1. refs.c: interpret @ as HEADRamkumar Ramachandra, Apr 30, 2013
  2. Duy NguyenApr 30, 2013
  3. Thomas RastApr 30, 2013
  4. Ramkumar RamachandraApr 30, 2013
  5. Duy NguyenApr 30, 2013
  6. Michael HaggertyApr 30, 2013
  7. Junio C HamanoApr 30, 2013
  8. Duy NguyenApr 30, 2013
  9. Ramkumar RamachandraApr 30, 2013
  10. Duy NguyenMay 1, 2013
  11. Thomas RastMay 1, 2013
  12. Ramkumar RamachandraApr 30, 2013
  13. Ramkumar RamachandraApr 30, 2013
  14. Felipe ContrerasApr 30, 2013
  15. Ramkumar RamachandraApr 30, 2013
  16. Junio C HamanoApr 30, 2013
  17. Ramkumar RamachandraApr 30, 2013
  18. Ramkumar RamachandraApr 30, 2013
  19. Ramkumar RamachandraApr 30, 2013
  20. Ramkumar RamachandraApr 30, 2013
  21. Felipe ContrerasApr 30, 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.