git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jakub Narebski <jnareb@gmail.com>
To: geoffrey.russell@gmail.com
Cc: git@vger.kernel.org
Subject: Re: finding deleted file names
Date: Thu, 03 Jul 2008 02:20:14 -0700 (PDT)	[thread overview]
Message-ID: <m3hcb7fho7.fsf@localhost.localdomain> (raw)
In-Reply-To: <93c3eada0807021701m13b7adddv51537f4cf9d52533@mail.gmail.com>

"Geoff Russell" <geoffrey.russell@gmail.com> writes:

> git diff --diff-filter=D --name-only HEAD@{'7 days ago'}

What did you want to find here?

> 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}

First, which version of git do you use? Because with git version 1.5.6.1
I get:

  1000:[master!git]$ git diff --diff-filter=D --name-only HEAD@{'10 years ago'}
  warning: Log for 'HEAD' only goes back to Fri, 4 Apr 2008 15:28:53 +0200.
  Documentation/core-tutorial.txt
  [...]

Second, [<ref>]@{<date>} refers to _local_ history of where _branch tip_
pointed in your repository, and is purely local information retrieved from
reflogs (which gets pruned / expired).  To refer to (find) commits by
commit creation date, use --since=<date>/--after=<date> or --until=<date>/
/--before=<date>.  There was even lately added information to git
documentation about difference bwetween [<ref>]@{<date>} and --before=<date>
and when to use one or the other.

> 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?

Because git allows joining two repositories into one (either union of
their top directories, or one put into subdirectory in other using so
called 'subtree' merge strategy) there can be more than one "root"
(parentless) commit.  In git repository there are 7 root commits, not
counting "disjoint" branches like 'html', 'man' and 'todo' which share
no history and doesn't join with mainline history.

They are: git-p4 (Perforce importer), git-gui, gitweb, gitk, git mail
tools, git,... and something strange (4e00220243).

 $ git rev-list --parents --branches --not html man todo | grep -v -e ' '

-- 
Jakub Narebski
Poland
ShadeHawk on #git

  parent reply	other threads:[~2008-07-03 12:23 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-07-03  0:01 finding deleted file names Geoff Russell
2008-07-03  1:12 ` Mikael Magnusson
2008-07-03  2:45   ` Geoff Russell
2008-07-03  3:18     ` Mikael Magnusson
2008-07-03 10:42     ` Jeff King
2008-07-04  6:45       ` Geoff Russell
2008-07-04  7:05         ` Junio C Hamano
2008-07-06  4:54           ` Geoff Russell
2008-07-06  5:17             ` Junio C Hamano
2008-07-07  0:41               ` Geoff Russell
2008-07-03  9:20 ` Jakub Narebski [this message]
2008-07-03 10:36 ` Jeff King
2008-07-03 19:41   ` Junio C Hamano
2008-07-03 19:47     ` Jeff King
2008-07-03 20:32   ` Shawn O. Pearce
2008-07-03 11:57 ` Johannes Schindelin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m3hcb7fho7.fsf@localhost.localdomain \
    --to=jnareb@gmail.com \
    --cc=geoffrey.russell@gmail.com \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).