From: Jakub Narebski <jnareb@gmail.com>
To: Ittay Dror <ittay.dror@gmail.com>
Cc: Git Mailing List <git@vger.kernel.org>
Subject: Re: locate commit by file
Date: Tue, 04 Nov 2008 01:57:39 -0800 (PST) [thread overview]
Message-ID: <m34p2ng6eq.fsf@localhost.localdomain> (raw)
In-Reply-To: <491003BC.7040206@gmail.com>
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
prev parent reply other threads:[~2008-11-04 9:59 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-11-04 8:11 locate commit by file Ittay Dror
2008-11-04 9:57 ` Jakub Narebski [this message]
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=m34p2ng6eq.fsf@localhost.localdomain \
--to=jnareb@gmail.com \
--cc=git@vger.kernel.org \
--cc=ittay.dror@gmail.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.