Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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