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

Re: [PATCH] refspec: make @ a valid refspec

From
Felipe Contreras <felipe.contreras@gmail.com>
Date
Nov 25, 2020, 00:14 UTC
Message-ID
<CAMP44s2Yt_Vin1rLg-q9Jt8pA+bTDMjYbwSaGHZLgoNKL_nEvg@mail.gmail.com>
In-Reply-To
<xmqqk0uagxei.fsf@gitster.c.googlers.com>
On Tue, Nov 24, 2020 at 5:14 PM Junio C Hamano <gitster@pobox.com> wrote:
>
> Jacob Keller <jacob.keller@gmail.com> writes:
Show 12 quoted lines
> > However, @{0} *does* refer to what is currently checked out, which
> > would be head.. So in a sense @ meaning "the current branch" and
> > applying @{0} would always be HEAD, no?
>
> Not really.
>
> It happens to hold true for @{0}, because by definition you couldn't
> have been on a different branch than the current one when you made
> the topmost commit on the current branch.  For @{1} and higher, it
> is always "where was the current branch at N commits ago?" which is
> different from "where was the HEAD at N commits ago?", unless you
> always use a single branch and never switch away.
But @{0} is always the same as HEAD@{0}, which is always the same as @.
-- 
Felipe Contreras
Previous: Junio C HamanoNext: Felipe Contreras
Message 11 of 13 in “refspec: make @ a valid refspec”
  1. refspec: make @ a valid refspecFelipe Contreras, Nov 22, 2020
  2. Jeff KingNov 24, 2020
  3. Junio C HamanoNov 24, 2020
  4. Felipe ContrerasNov 24, 2020
  5. Junio C HamanoNov 24, 2020
  6. Jacob KellerNov 24, 2020
  7. Junio C HamanoNov 24, 2020
  8. Jacob KellerNov 24, 2020
  9. Felipe ContrerasNov 25, 2020
  10. Junio C HamanoNov 25, 2020
  11. Felipe ContrerasNov 25, 2020
  12. Felipe ContrerasNov 25, 2020
  13. Felipe ContrerasDec 4, 2020

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.