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

Re: finding deleted file names

From
Geoff Russell <geoffrey.russell@gmail.com>
Date
Jul 4, 2008, 06:45 UTC
Message-ID
<93c3eada0807032345r2ff59d69kca42bc9ea7782f31@mail.gmail.com>
In-Reply-To
<20080703104233.GA26162@sigill.intra.peff.net>
On 7/3/08, Jeff King <peff@peff.net> wrote:
Show 29 quoted lines
> On Thu, Jul 03, 2008 at 12:15:37PM +0930, Geoff Russell wrote:
>
>  > >> 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").

You guys are (quite properly) worried about all the edge cases and I have probably confused things by using the reflog when they may be a better way of doing things.

Perhaps if I describe the problem, there may be a better solution than using the reflog. I've made a bunch of changes to a repository, a few weeks later I figure I've deleted a file I need but am not really sure of its name. So I want to list the files that I've deleted during the past few weeks. So the aim is to find the files that aren't in the current working directory but that are in some commit done since day X.

Cheers, Geoff

>
>  -Peff
>
-- 
6 Fifth Ave,
St Morris, S.A. 5068
Australia
Ph: 041 8805 184 / 08 8332 5069
Previous: Jeff KingNext: Junio C Hamano
Message 6 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.