]> git.lizzy.rs Git - rust.git/blob - util/fetch_prs_between.sh
Merge remote-tracking branch 'upstream/rust-1.38.0' into backport_merge
[rust.git] / util / fetch_prs_between.sh
1 #!/bin/bash
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" --grep "Rollup 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   message=$(git --no-pager show --pretty=medium "$commit")
18   if [[ -n $(echo "$message" | rg "^[\s]{4}changelog: [nN]one\.*$") ]]; then
19     continue
20   fi
21
22   echo "URL: https://github.com/rust-lang/rust-clippy/pull/$id"
23   echo "$message"
24   echo "---------------------------------------------------------"
25   echo
26 done