Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save npotier/b6a04b9ed74eecceafd61da4ac972fb2 to your computer and use it in GitHub Desktop.
Save npotier/b6a04b9ed74eecceafd61da4ac972fb2 to your computer and use it in GitHub Desktop.
Show who contributed to your vendors folder
# 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