Which file is older in history?
- From
Ramkumar Ramachandra <artagnon@gmail.com>
- Date
- Mar 20, 2013, 20:21 UTC
- Message-ID
- <CALkWK0nTjoR9qBY-hnkrDKnyf8088ZDJ1LK_zNqAoAB7ndvaww@mail.gmail.com>
Hi,
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 query whether there are commits between them (`rev-list commit1 ^commit2`). However, this is slow. What about bisecting the history until we find a tree that contains one file but not the other?
Thanks.
Ram