-
-
Save rmondello/3356625 to your computer and use it in GitHub Desktop.
Find your contributions to a git repo, by file
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# A regex that matches your commit name. Escape colons, if you use any. | |
NAME="(Phil(lip)? Tang|[email protected])" | |
# Find all plaintext files. Warning: Can be slow with moderate or large repos | |
FILES=(`find . -type f -exec sh -c "file {} | grep text >/dev/null" \; -print`) | |
# Find files with extension ".coffee" or ".sass" | |
FILES=(`find . -name "*.coffee" -o -name "*.sass"`) | |
for FILE in ${FILES[@]} | |
do | |
git blame $FILE | cut -f 2 -d "(" | cut -f 1,2 -d " " | tr -d "(" | sort | uniq -c | grep -E "$NAME" | sed -E "s:$NAME:$FILE:" | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment