2019-10-21 03:09:53 -05:00
|
|
|
#!/bin/bash
|
2019-01-25 11:07:50 -06:00
|
|
|
|
|
|
|
# Fetches the merge commits between two git commits and prints the PR URL
|
|
|
|
# together with the full commit message
|
|
|
|
#
|
|
|
|
# If you want to use this to update the Clippy changelog, be sure to manually
|
|
|
|
# exclude the non-user facing changes like 'rustup' PRs, typo fixes, etc.
|
|
|
|
|
|
|
|
first=$1
|
|
|
|
last=$2
|
|
|
|
|
|
|
|
IFS='
|
|
|
|
'
|
2019-08-28 06:53:56 -05:00
|
|
|
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
|
2019-10-21 03:09:53 -05:00
|
|
|
id=$(echo "$pr" | rg -o '#[0-9]{3,5}' | cut -c 2-)
|
|
|
|
commit=$(echo "$pr" | cut -d' ' -f 1)
|
|
|
|
message=$(git --no-pager show --pretty=medium "$commit")
|
|
|
|
if [[ -n $(echo "$message" | rg "^[\s]{4}changelog: [nN]one\.*$") ]]; then
|
2019-08-12 02:38:52 -05:00
|
|
|
continue
|
|
|
|
fi
|
|
|
|
|
2019-01-25 11:07:50 -06:00
|
|
|
echo "URL: https://github.com/rust-lang/rust-clippy/pull/$id"
|
2020-04-20 14:08:55 -05:00
|
|
|
echo "Markdown URL: [#$id](https://github.com/rust-lang/rust-clippy/pull/$id)"
|
2019-08-12 02:38:52 -05:00
|
|
|
echo "$message"
|
2019-10-21 03:09:53 -05:00
|
|
|
echo "---------------------------------------------------------"
|
|
|
|
echo
|
2019-01-25 11:07:50 -06:00
|
|
|
done
|