Re: Which file is older in history?
- From
Ramkumar Ramachandra <artagnon@gmail.com>
- Date
- Mar 21, 2013, 11:59 UTC
- Message-ID
- <CALkWK0nRgzNYViKSx97OyHVOQmFN61Ex9EUvr1JK-0=GX=uX0w@mail.gmail.com>
- In-Reply-To
- <7vobeddcjq.fsf@alter.siamese.dyndns.org>
Junio C Hamano wrote:
Show 11 quoted lines
> Ramkumar Ramachandra <artagnon@gmail.com> writes: > >> I want to compare two files in a git repository and tell which one was >> introduced into the repository earlier, assuming that they're in the >> same history line (by ancestry, not timestamp). The naive way to do >> this is to find the individual commits that introduced the files >> (`rev-list HEAD -- <filename> | tail -n 1`), and... > > This must be a trick question but the naïve way I think of is > > git log --diff-filter=A -- path1 path2
Thanks, I didn't know about --diff-filter. I'll need one extra step to figure out which commit corresponds to the introduction of which file, no?