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

First/oldest entry in reflog dropped

From
Martin von Zweigbergk <martin.von.zweigbergk@gmail.com>
Date
Nov 21, 2010, 03:11 UTC
Message-ID
<AANLkTiktGbeSmUB75kn3q=swnw=cHvivX21OkR3sJJDC@mail.gmail.com>
Can someone explain the behavior in the execution below?

# I expected this reflog... $ git branch tmp $ git reflog show refs/heads/tmp b60a214 refs/heads/tmp@{0}: branch: Created from master

# ... and this one as well... $ git update-ref refs/heads/tmp HEAD^ $ git reflog show refs/heads/tmp 7d1a0b8 refs/heads/tmp@{0}: b60a214 refs/heads/tmp@{1}: branch: Created from master

# ... but why is the first entry (i.e. "branch: Created from master") # dropped here? $ git update-ref refs/heads/tmp HEAD $ git reflog show refs/heads/tmp b60a214 refs/heads/tmp@{0}: 7d1a0b8 refs/heads/tmp@{1}:

If the ref is updated once more (to e.g. HEAD^^) before being moved back to HEAD, the first entry will be shown in the output.

If this is a bug, it seems to be in reflog, rather than in update-ref, because the first entry does exist in .git/logs/refs/heads/tmp.

Thanks, Martin

Next: Jeff King
Message 1 of 8 in “First/oldest entry in reflog dropped”
  1. Martin von ZweigbergkNov 21, 2010
  2. Jeff KingNov 21, 2010
  3. Johannes SchindelinNov 21, 2010
  4. Jeff KingNov 22, 2010
  5. Johannes SchindelinNov 22, 2010
  6. Junio C HamanoNov 24, 2010
  7. Jeff KingNov 25, 2010
  8. Martin von ZweigbergkNov 21, 2010

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.