Re: finding deleted file names

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

 



2008/7/3 Geoff Russell <geoffrey.russell@xxxxxxxxx>:
> On Thu, Jul 3, 2008 at 10:42 AM, Mikael Magnusson <mikachu@xxxxxxxxx> wrote:
>> 2008/7/3 Geoff Russell <geoffrey.russell@xxxxxxxxx>:
>>> git diff --diff-filter=D --name-only HEAD@{'7 days ago'}
>>>
>>> finds files deleted during the last 7 days, but if my repository is
>>> only 6 days old I get a
>>> fatal error.
>>>
>>> fatal: bad object HEAD@{7 days ago}
>>>
>>> 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?

In git.git, the gitk subdirectory has a separate root because it was merged
with the subtree merge strategy, so if you go down the second parent of that
merge commit, you'll end up not at the start of the git history. You can
see this if you just fetch any other repo into your current one and merge it.
Just add everything with conflict markers in if it conflicts and commit,
then look at gitk :). (and obviously then revert the merge or whatever).

Btw, after you git init, there are 0 commits, the first commit is created
when you run git commit the first time.

-- 
Mikael Magnusson
--
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]

  Powered by Linux