Skip to content

Instantly share code, notes, and snippets.

@syohex
Created March 26, 2020 00:03
Show Gist options
  • Save syohex/2a4a367ed00ea0fd9c931e62977b0c64 to your computer and use it in GitHub Desktop.
Save syohex/2a4a367ed00ea0fd9c931e62977b0c64 to your computer and use it in GitHub Desktop.
#!/usr/bin/env bash
set -e
declare -A counts
for file in $(git ls-files)
do
count=$(git shortlog -s -n --all --no-merges $file | wc -l)
counts[$file]=$count
done
max=-1
max_file=
for k in "${!counts[@]}"
do
if [[ ${counts[$k]} -gt $max ]]; then
max=${counts[$k]}
max_file=$k
fi
done
printf "Most people modify $max_file($max people)\n"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment