Skip to content

Instantly share code, notes, and snippets.

@iLoveTux
Created February 2, 2016 19:13
Show Gist options
  • Save iLoveTux/749f6ed1cbd4591eb779 to your computer and use it in GitHub Desktop.
Save iLoveTux/749f6ed1cbd4591eb779 to your computer and use it in GitHub Desktop.
list files by number of commits in repository
git log --name-only --decorate=short --sparse --format=oneline | grep "/" | grep -v " " > /tmp/files-changed.txt
cat /tmp/files-changed.txt | sort | uniq -c > /tmp/changes-by-file.txt
cat /tmp/changes-by-file.txt | sort -r
@iLoveTux
Copy link
Author

iLoveTux commented Feb 2, 2016

This can be very useful in identifying buggy pieces of code in a repository, which is especially useful when working with code which doesn't have a proper test suite. You can run this in a repository and focus your testing efforts on the files with the highest number of commits.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment