aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJakub Kicinski <kuba@kernel.org>2023-04-21 09:11:10 -0700
committerDaniel Borkmann <daniel@iogearbox.net>2023-04-24 10:24:18 +0200
commit2ae7bb1b1c03333794b0555fa281193712463615 (patch)
tree8612d7a523f38891927456d310f6280cb702bfa4
parentbe2fda7a60f31f8244300775a2ae2d25e733ac6e (diff)
downloadpw-2ae7bb1b1c03333794b0555fa281193712463615.tar.gz
pw-pull: Propagate tags onto pull requests
Some reviewers review pull requests and should be rewarded for it. Since we can't change the commits try to at least propagate the tags sent in response to the PR or cover letter. Signed-off-by: Jakub Kicinski <kuba@kernel.org> Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
-rwxr-xr-xpw-pull22
1 files changed, 21 insertions, 1 deletions
diff --git a/pw-pull b/pw-pull
index c12c795..3f5c307 100755
--- a/pw-pull
+++ b/pw-pull
@@ -14,14 +14,30 @@ source $(dirname $0)/lib.sh
usage()
{
cat <<-EOF
- usage: pw-pull [-p PULL] [-s SERIES] [-c] [-P PULL_URL] [-h]
+ usage: pw-pull [-p PULL] [-s SERIES] [-c] [-P PULL_URL] [-T] [-h]
EOF
exit
}
+get_cover_tags()
+{
+ [ -z "$cover_tags" ] && return
+
+ # first arg is JSON either of cover or of the pull
+ local json="$1"
+
+ clink=$(echo "$json" | jq -r '.url')
+ link=$(curl -s "$clink" | jq -r '.comments')
+ [ "$link" == "null" ] && return
+
+ echo -ne "$(curl -s $link | jq -r '.[].content')" |
+ sed -n '/^\(Ack\|Review\|Test\)ed-[Bb]y:/p'
+}
+
pull=""
pull_url=""
cover=""
+cover_tags="y"
series=""
series_branch="tmp"
head_old=$(git rev-parse --verify HEAD)
@@ -31,6 +47,7 @@ while true; do
-s | --series ) series="$2"; shift 2 ;;
-c | --pull-from-cover ) cover="y"; shift ;;
-P | --pull-url ) pull_url="$2"; shift 2 ;;
+ -T | --no-cover-tags) cover_tags=""; shift ;;
-h | --help ) usage; break ;;
-- ) shift; break ;;
* ) break ;;
@@ -90,6 +107,7 @@ elif [ ! -z "$cover" ]; then
json=$cover_json
fi
+tags="$(get_cover_tags "$json")"
# Download the series from ML and make a local branch
if [ ! -z "$series" ]; then
mbox_from_series $series
@@ -142,6 +160,7 @@ $pull_msg
$merge_body
====================
+$tags
Link: https://lore.kernel.org/r/$pull_msgid
EOF
else
@@ -155,6 +174,7 @@ $pull_author says:
$merge_body
====================
+$tags
Link: https://lore.kernel.org/r/$pull_msgid
EOF
fi