aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Borkmann <daniel@iogearbox.net>2022-10-07 23:57:33 +0200
committerDaniel Borkmann <daniel@iogearbox.net>2022-10-08 00:05:56 +0200
commitac51fc476675204eab7c0f8e40a1b9f1b5920eff (patch)
treea25478ea1f2b49da4bf5ca4a6d9e7eeb9acec00f
parent8f31c91ff04befe2a82e0e187130629a3b03a655 (diff)
downloadpw-ac51fc476675204eab7c0f8e40a1b9f1b5920eff.tar.gz
pw-request-pull: Signing support for PRs
Now `pw-request-pull -t bpf-next -S` will create signed PRs. Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
-rw-r--r--README5
-rwxr-xr-xpw-request-pull11
2 files changed, 14 insertions, 2 deletions
diff --git a/README b/README
index e138f24..c91e02c 100644
--- a/README
+++ b/README
@@ -329,10 +329,15 @@ For bpf & bpf-next tree dirs:
Git signing/pushing/deleting tags for PR:
+ $ pw-request-pull -t bpf-next -S
+
+ Manual steps would look like:
+
$ git tag -s bpf-for-net
$ git verify-tag bpf-for-net
$ git push origin bpf-for-net
# after pull got merged
+
$ git push --delete origin bpf-for-net
$ git tag -d bpf-for-net
diff --git a/pw-request-pull b/pw-request-pull
index bad8d85..3763c7c 100755
--- a/pw-request-pull
+++ b/pw-request-pull
@@ -6,19 +6,21 @@
usage()
{
cat <<-EOF
- usage: pw-request-pull [-h] [-t TREE] [-s SINCE_COMMIT]
+ usage: pw-request-pull [-h] [-t TREE] [-s SINCE_COMMIT] [-S]
EOF
exit
}
remote=""
since=""
+sign=""
tree=""
today=$(date +%Y-%m-%d)
while true; do
case "$1" in
-s | --since ) since="$2"; shift 2 ;;
+ -S | --sign ) sign="for-netdev"; shift ;;
-t | --tree ) tree="$2"; shift 2 ;;
-h | --help ) usage; break ;;
* ) break ;;
@@ -43,7 +45,12 @@ delta=$((($new - $old)/(60*60*24)+1))
count=$(git rev-list --no-merges --count $since...HEAD)
thanks=$(git log --no-merges $since...HEAD --format="%b" | awk '$1 ~ /Reported-by:|Acked-by:|Reviewed-by:|Tested-by:/' | cut -d ' ' -f2- | cut -d '<' -f1 | awk '{$1=$1};1' | grep -v '@' | sort | uniq | sort -n | sed ':a;N;$!ba;s/\n/, /g' | fold -s -w73)
file="pr-$tree-$today.patch"
-git request-pull $since ${remote[1]} > $file
+if [ ! -z "$sign" ]; then
+ git tag -s $sign -m "${remote[0]}-$sign"
+ git verify-tag $sign
+ git push origin $sign
+fi
+git request-pull $since ${remote[1]} $sign > $file
what=$(cat $file | grep "files changed")
echo -e "Subject: pull-request: $tree $today\n\nHi David, hi Jakub, hi Paolo, hi Eric,\n\nThe following pull-request contains BPF updates for your *${remote[0]}* tree.\n\nWe've added $count non-merge commits during the last $delta day(s) which contain\na total of$what.\n\nThe main changes are:\n\n1) ..., from XYZ. Among others:\n\n - Blah blah sub item.\n\n2) ..., from ABC.\n\nPlease consider pulling these changes from:\n\n git://git.kernel.org/pub/scm/linux/kernel/git/bpf/$tree.git\n\nThanks a lot!\n\nAlso thanks to reporters, reviewers and testers of commits in this pull-request:\n\n$thanks\n\n----------------------------------------------------------------\n\n$(cat $file)" > $file