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

accessing oldest reflog entry with ref@{N}?

From
SZEDER Gábor <szeder@ira.uka.de>
Date
Jun 19, 2013, 12:50 UTC
Message-ID
<20130619125059.GD20052@goldbirke>
Hi,

after a couple of months of inactivity I recently updated my git clone from the main repo, and later ran 'git gc', which, of course, dutifully pruned the old reflog entries, leaving my reflogs quite shallow:

$ git reflog master 0dbd8125 master@{0}: merge origin/master: Fast-forward f3828dc0

Then later I had to access the previous state, which I usually do with master@{1}, but not this time:

$ git log --oneline -1 master@{1} fatal: Log for 'master' only has 1 entries.

Annoyed, I just copy-pasted the sha and got the job done.

However, I wonder why it didn't worked. 'git reflog' didn't print master@{1} or any message for the oldest entry, but I can live without that. The sha is undoubtedly there, however, so git should know where master@{1} points and should "Just Work", shouldn't it?

Thanks, Gábor

Next: Junio C Hamano
Message 1 of 3 in “accessing oldest reflog entry with ref@{N}?”
  1. SZEDER GáborJun 19, 2013
  2. Junio C HamanoJun 19, 2013
  3. Jeff KingJun 19, 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.