Skip to content

Instantly share code, notes, and snippets.

@caseysoftware
Created June 20, 2014 16:07
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save caseysoftware/ff633fc0640635ed8f84 to your computer and use it in GitHub Desktop.
Save caseysoftware/ff633fc0640635ed8f84 to your computer and use it in GitHub Desktop.
git log --name-only | grep php --exclude=trunk | sort | uniq -c | sort -nr | head -n 25 > churn.txt
This one looks like an odd ball but what it does is:
- looks at the git log file, retrieving just the filenames;
- greps to extract those filenames, excluding anything from the old SVN /trunk structure;
- sorts the list of files to get the duplicates together;
- eliminates the duplicates but keeps a count of them;
- resorts the file names by that count; and
- retrieves the top 25 entries.
It's a variant of Katrina Owen's one-liner here: https://twitter.com/kytrinyx/status/358065717179973634
@caseysoftware
Copy link
Author

You should tweak the "grep php" part to use file extensions that are relevant to your code.

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