2

I'm doing a kind of archeology for my team's Git repo. The goal is to find all overlapping commits, e.g. all pairs of commits touching the same lines of code.

I tried to do this with diff and blame commands. The first one is not that reliable since code line ranges it provides have a sort of relative addressing. And it's hardly to track these addresses through 1000+ commits. The second option gives nice per file output but without any intermediate information (especially on deleting of a code lines).

I believe there must be a better way to achieve my goal. Looking forward for any advice!

Wladd
  • 21
  • 4
  • Would git bisect help? – evolutionxbox Apr 19 '18 at 09:37
  • https://stackoverflow.com/questions/4404444/how-do-i-git-blame-a-deleted-line – Varun Garg Apr 19 '18 at 10:52
  • Thanks for responses! I've read the post about blame already and bisect won't help me more then the rest commands. The problem is that I'm not looking for a commit with a particular properties, but I'm looking for a commits touching a particular commit. – Wladd Apr 19 '18 at 11:49

1 Answers1

0

I've successfully used a tool written by Albert, see this answer. The source is in GitHub: git-find-related-commits.py.

The tool compares the diff of each pair of commits in a branch to find most overlapping commits (as I understand it).

akaihola
  • 26,309
  • 7
  • 59
  • 69