Git development
 help / color / mirror / Atom feed
* locate commit by file
@ 2008-11-04  8:11 Ittay Dror
  2008-11-04  9:57 ` Jakub Narebski
  0 siblings, 1 reply; 2+ messages in thread
From: Ittay Dror @ 2008-11-04  8:11 UTC (permalink / raw)
  To: Git Mailing List

Hi,


Given a file, is there an easy way (e.g., not bisectig) to find the 
latest commit where the file content is the same?


Meaning: I have a file /tmp/A and I want to file the latest commit where 
a/b/A is identical (content wise) to /tmp/A.


Thank you,

Ittay


-- 
--
Ittay Dror <ittay.dror@gmail.com>

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: locate commit by file
  2008-11-04  8:11 locate commit by file Ittay Dror
@ 2008-11-04  9:57 ` Jakub Narebski
  0 siblings, 0 replies; 2+ messages in thread
From: Jakub Narebski @ 2008-11-04  9:57 UTC (permalink / raw)
  To: Ittay Dror; +Cc: Git Mailing List

Ittay Dror <ittay.dror@gmail.com> writes:

> Given a file, is there an easy way (e.g., not bisecting) to find the
> latest commit where the file content is the same?
> 
> Meaning: I have a file /tmp/A and I want to file the latest commit
> where a/b/A is identical (content wise) to /tmp/A.

Do you mean: find the commit which changed file to current version?
I think that

  $ git rev-parse -1 -- file

Would work (but better check "git log -- file").

If you want to find which version corresponds to given contents, you
would have to find sha-1 of /tmp/A (using "git hash-object"), and
find it in difftree searching for sha ("git log --raw -- file", or
just "git log --raw" if you are not sure about name).

I think you can fins such script in mailing list archives...
-- 
Jakub Narebski
Poland
ShadeHawk on #git

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2008-11-04  9:59 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-11-04  8:11 locate commit by file Ittay Dror
2008-11-04  9:57 ` Jakub Narebski

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox