Skip to content

Instantly share code, notes, and snippets.

@jannfis
Last active March 13, 2022 21:52
Show Gist options
  • Save jannfis/c659d6e704fa80fa3215070f885e10c4 to your computer and use it in GitHub Desktop.
Save jannfis/c659d6e704fa80fa3215070f885e10c4 to your computer and use it in GitHub Desktop.
Find all contributors for a given range of commits
#!/bin/sh
set -e
set -o pipefail
REVRANGE="$1"
if test "$REVRANGE" = ""; then
echo "USAGE: $0 <revrange>" >&2
exit 1
fi
for commit in $(git log ${REVRANGE} --oneline | awk '{print $1}'); do
gh pr list --state merged --search "$commit" --json author --template '{{range .}}{{printf "@%s\n" .author.login}}{{end}}'
done | sort | uniq
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment