Forked from Nyholm/gist:317df136ded2087649d0c9c464285cb1
Created
April 2, 2018 20:30
-
-
Save npotier/b6a04b9ed74eecceafd61da4ac972fb2 to your computer and use it in GitHub Desktop.
Show who contributed to your vendors folder
This file contains hidden or 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
# Install git fame | |
gem install git_fame | |
# Install all vendors with source | |
rm -rf vendor/* | |
composer update --prefer-source | |
# Do the calculations. This might take 30 minutes to complete. | |
rm output.txt | |
find ./vendor -type d -depth 2 ! -path "./vendor/composer" -exec echo {} \; -exec git fame --sort=loc --hide-progressbar --repository={} \; >> output.txt | |
# Print the result | |
awk -F "|" '/\|.*\| [0-9]/ {gsub(/[ \t]+$/, "", $2); print $2 "|" $3}' output.txt | awk -F "|" '{ arr[$1]+=$2 } END { for (key in arr) printf("%s\t%s\n", arr[key], key) }' | sort -r -g > output_sorted.txt | |
cat output_sorted.txt |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment