Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
#!/bin/sh
set -e
BASE_BRANCH="develop"
suggest_reviewers() {
echo '*Suggested Reviewers*\n--------------------'
collect_file_names | blame_files
}
collect_file_names() {
git diff --name-only HEAD $BASE_BRANCH
}
blame_files() {
xargs -L 1 git blame --line-porcelain | count_lines
}
count_lines() {
sed -n 's/^author //p' | authors_of_most_lines
}
authors_of_most_lines() {
sort | uniq -c | sort -rn | head -3
}
suggest_reviewers
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.