Skip to content

Commit 1adc357

Browse files
committed
Add script to fetch GitHub PRs between two commits
1 parent 1e4f448 commit 1adc357

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

util/fetch_prs_between

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
#!/bin/sh
2+
3+
# Fetches the merge commits between two git commits and prints the PR URL
4+
# together with the full commit message
5+
#
6+
# If you want to use this to update the Clippy changelog, be sure to manually
7+
# exclude the non-user facing changes like 'rustup' PRs, typo fixes, etc.
8+
9+
first=$1
10+
last=$2
11+
12+
IFS='
13+
'
14+
for pr in $(git log --oneline --grep "Merge #" --grep "Merge pull request" --grep "Auto merge of" "$first...$last" | sort -rn | uniq); do
15+
id=$(echo $pr | rg -o '#[0-9]{3,5}' | cut -c 2-)
16+
commit=$(echo $pr | cut -d' ' -f 1)
17+
echo "URL: https://github.com/rust-lang/rust-clippy/pull/$id"
18+
echo "$(git --no-pager show --pretty=medium $commit)"
19+
echo "---------------------------------------------------------\n"
20+
done

0 commit comments

Comments
 (0)