about summary refs log tree commit diff
diff options
context:
space:
mode:
authorPhilipp Hansch <dev@phansch.net>2019-01-25 18:07:50 +0100
committerPhilipp Hansch <dev@phansch.net>2019-01-25 18:07:50 +0100
commit1adc35703f22c9ee4e825ca0441961cbc832e5c8 (patch)
treefe116e0c34efb2a716a4b66307082a068c2daf90
parent1e4f44853c13ae3e669996a265234f95baf957fe (diff)
downloadrust-1adc35703f22c9ee4e825ca0441961cbc832e5c8.tar.gz
rust-1adc35703f22c9ee4e825ca0441961cbc832e5c8.zip
Add script to fetch GitHub PRs between two commits
-rwxr-xr-xutil/fetch_prs_between20
1 files changed, 20 insertions, 0 deletions
diff --git a/util/fetch_prs_between b/util/fetch_prs_between
new file mode 100755
index 00000000000..dbe73b1ba98
--- /dev/null
+++ b/util/fetch_prs_between
@@ -0,0 +1,20 @@
+#!/bin/sh
+
+# 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='
+'
+for pr in $(git log --oneline --grep "Merge #" --grep "Merge pull request" --grep "Auto merge of" "$first...$last" | sort -rn | uniq); do
+  id=$(echo $pr | rg -o '#[0-9]{3,5}' | cut -c 2-)
+  commit=$(echo $pr | cut -d' ' -f 1)
+  echo "URL: https://github.com/rust-lang/rust-clippy/pull/$id"
+  echo "$(git --no-pager show --pretty=medium $commit)"
+  echo "---------------------------------------------------------\n"
+done