git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: finding deleted file names

From
Jakub Narebski <jnareb@gmail.com>
Date
Jul 3, 2008, 09:20 UTC
Message-ID
<m3hcb7fho7.fsf@localhost.localdomain>
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
Previous: Geoff RussellNext: Jeff King
Message 11 of 16 in “finding deleted file names”
  1. Geoff RussellJul 3, 2008
  2. Mikael MagnussonJul 3, 2008
  3. Geoff RussellJul 3, 2008
  4. Mikael MagnussonJul 3, 2008
  5. Jeff KingJul 3, 2008
  6. Geoff RussellJul 4, 2008
  7. Junio C HamanoJul 4, 2008
  8. Geoff RussellJul 6, 2008
  9. Junio C HamanoJul 6, 2008
  10. Geoff RussellJul 7, 2008
  11. Jakub NarebskiJul 3, 2008
  12. Jeff KingJul 3, 2008
  13. Junio C HamanoJul 3, 2008
  14. Jeff KingJul 3, 2008
  15. Shawn O. PearceJul 3, 2008
  16. Johannes SchindelinJul 3, 2008

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.