diff --git a/.gitignore b/.gitignore index 499f014..3de7b78 100644 --- a/.gitignore +++ b/.gitignore @@ -4,4 +4,5 @@ gource.ppm gource.mp4 *.txt *.mp4 -.DS_Store \ No newline at end of file +.DS_Store +*.bak \ No newline at end of file diff --git a/count-commits.sh b/count-commits.sh new file mode 100755 index 0000000..1e46a18 --- /dev/null +++ b/count-commits.sh @@ -0,0 +1,32 @@ +#!/bin/sh + +# You need to have jq installed + +echo "COUNTING COMMITS" + +sum=0 +for OUTPUT in $(ls -d */ | grep adyen) +do + cd $OUTPUT; + number=$(git rev-list --count HEAD --after=2021-01-01) + sum=$((sum + number)) + cd ..; +done +echo "The total number of commits across repositories is: $sum" + +echo "COUNTING PRs" + +prs=$(curl -s "https://api.github.com/search/issues?q=org:adyen%20type:pr%20is:merged%20merged:%3E=2021-01-01" | jq '.total_count') + +echo "The total number of merged PRs across repositories is: $prs" + +echo "COUNTING Issues" + +issues=$(curl -s "https://api.github.com/search/issues?q=org:adyen%20type:issue%20closed:%3E2021-01-01" | jq '.total_count') + +echo "The total number of closed Issues across repositories is: $issues" + +echo "COUNTING Contributors" + +contributors=$(python3 unique-commiters.py) +echo "The total number of contributors across repositories is: $contributors" diff --git a/unique-commiters.py b/unique-commiters.py new file mode 100644 index 0000000..22ec44e --- /dev/null +++ b/unique-commiters.py @@ -0,0 +1,11 @@ +# This script depends on the combined.txt file created by all-repos.sh to be present. + + +commiters = [] +with open('combined.txt', 'r') as reader: + for line in reader.readlines(): + author = line.split("|")[1] + if author not in commiters: + commiters.append(author) + +print(str(len(commiters)))