]> git.lizzy.rs Git - rust.git/blobdiff - util/fetch_prs_between.sh
Auto merge of #10007 - Jarcho:issue_10005, r=giraffate
[rust.git] / util / fetch_prs_between.sh
index dbe73b1ba9856e08b5f430eae175a91fb5784881..6865abf971b282891e1da574766c4b0d577c5cac 100755 (executable)
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash
 
 # Fetches the merge commits between two git commits and prints the PR URL
 # together with the full commit message
@@ -11,10 +11,17 @@ 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)
+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
+  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
+    continue
+  fi
+
   echo "URL: https://github.com/rust-lang/rust-clippy/pull/$id"
-  echo "$(git --no-pager show --pretty=medium $commit)"
-  echo "---------------------------------------------------------\n"
+  echo "Markdown URL: [#$id](https://github.com/rust-lang/rust-clippy/pull/$id)"
+  echo "$message"
+  echo "---------------------------------------------------------"
+  echo
 done