Last active
June 16, 2022 05:11
-
-
Save yongjhih/0d168ea4472fbbe13a8df9bb5f6faa8f to your computer and use it in GitHub Desktop.
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
#!/usr/bin/env bash | |
while read f; do | |
# Max commits | |
# owner="$(git shortlog -n -s "$f" | head -1 | cut -f 2)" | |
# Max lines | |
#owner="$(git blame -c "$f" | awk '{print $3}' | sort | uniq -c | sort -r | head -1 | awk '{print $2}')" | |
owner="$(git blame --line-porcelain "$f" | grep '^author ' | sed 's|^author ||' | sort | uniq -c | sort -r | head -1 | awk '!($1="")' | sed 's|^ *||g' | sed 's| *$||g')" | |
echo -e "$f\t$owner" | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment