Re: finding deleted file names
From: Jeff King <hidden>
Date: 2016-06-15 22:44:53
On Thu, Jul 03, 2008 at 12:15:37PM +0930, Geoff Russell wrote:
quoted
quoted
Is there something that says "since repository creation", ie., go back as far as possible, but no further? Is there a symbolic name for the initial commit?There's no symbolic name for it, since there might not be only one initial commit. git.git for example has at least three root commits. You will probably get what you want with $(git rev-list HEAD|tail -1). If your history is very large, $(git rev-list --reverse HEAD|head -1) is slightly faster, but usually not enough to offset typing --reverse :).Thanks for this, but I'm a little confused. If I do a "git init", there must be a first commit after this? Isn't this the first commit, how can there be more than one first commit?
The confusing part is that you two are talking about two slightly
different things. If you define "initial commit" as "the commit which
has no parents" then there can be many (you get a new one anytime you
merge in a project with unrelated history).
However, what Geoff originally mentioned was HEAD{'7 days ago'}, which
actually looks in the reflog. So if you define "initial commit" as "the
first commit value that this ref ever had" then there is only one
(though of course, your reflog will eventually expire, so it won't be
"the oldest value this ref ever had" but rather "the oldest one the
reflog ever remembers it having").
-Peff