Add find-reviewer script, which finds the most suitable reviewers for the last commit

This commit is contained in:
Ricardo Guiraldelli 2024-04-04 21:01:06 +03:00
parent 6cd7ae8513
commit 4a8910419b
1 changed files with 12 additions and 0 deletions

12
find-reviewer.sh Normal file
View File

@ -0,0 +1,12 @@
function find-reviewer {
git rev-parse --show-toplevel >/dev/null 2>&1 &&
git log -1 --oneline --stat --name-only |
sed -ne '2,$p' |
while read FILE; do
GIT_PAGER=cat git log --format='%ae' -- "$FILE";\
done |
sort |
uniq -c |
sort -nr ||
echo "ERROR: '$PWD' is not a Git repository." >&2
}