Re: accessing oldest reflog entry with ref@{N}?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



SZEDER Gábor <szeder@xxxxxxxxxx> writes:

> $ 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.

There lies your answer, no?

Each of the log entry records "this was before, and this is after
the change".  ref@{0} reads from the "after" field of 0-th (from the
end) entry. ref@{1} reads from the "after" field of 1-st (again from
the end) entry.  ref@{N} reads from the "after" field of N-th (again
from the end) entry.

Notice that nowhere in the above sequence we read from "before" field.


--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]