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