Skip to content

Instantly share code, notes, and snippets.

@danbeam
Created February 1, 2013 01:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save danbeam/4688476 to your computer and use it in GitHub Desktop.
Save danbeam/4688476 to your computer and use it in GitHub Desktop.
find authors in chrome's code
find_authors() {
local locations;
[ $# -eq 0 ] && locations='.' || locations="$@";
for loc in $locations; do
echo "finding top 3 authors for: $loc";
local dir;
[ -d "$loc" ] && dir="$loc" || dir="`dirname "$loc"`";
local vcs;
if [ -d "$dir/.svn" ]; then
find "$loc" -type f | grep -v '\/.svn' | \
xargs -I{} svn blame -r HEAD {} | cut -d ' ' -f2- | cut -d '@' -f1;
else
find "$loc" -type f | xargs -I{} git blame HEAD -- {} | \
egrep -o '[a-f0-9]+ \(\w+@\w+' | cut -d '@' -f 1 | cut -d '(' -f2;
fi | sort | uniq -c | sort -nr | head -3;
done;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment