From 0fed27b109aef09848fa826a5444f1b65271d510 Mon Sep 17 00:00:00 2001 From: Anna Schumaker Date: Mon, 16 May 2022 17:02:29 -0400 Subject: [PATCH] submit-patches.zsh: Greatly improve the script Take a command line option for who to send to, rather than relying on having the proper variable set or commented out. Also, add some tab completion. Signed-off-by: Anna Schumaker --- completions/_submit-patches.zsh | 9 +++++++++ submit-patches.sh | 13 ------------- submit-patches.zsh | 25 +++++++++++++++++++++++++ 3 files changed, 34 insertions(+), 13 deletions(-) create mode 100644 completions/_submit-patches.zsh delete mode 100755 submit-patches.sh create mode 100755 submit-patches.zsh diff --git a/completions/_submit-patches.zsh b/completions/_submit-patches.zsh new file mode 100644 index 0000000..f22b576 --- /dev/null +++ b/completions/_submit-patches.zsh @@ -0,0 +1,9 @@ +#compdef submit-patches.zsh + +function _submit-patches.zsh() { + _arguments \ + --nfs'[submit to nfs maintainers]' \ + --nfsd'[submit to nfsd maintainers]' \ + --nfsutils'[submit to nfs-utils maintainers]' \ + {--xfstests,--fstests}'[submit to xfstests maintainers]' +} diff --git a/submit-patches.sh b/submit-patches.sh deleted file mode 100755 index 097eb5f..0000000 --- a/submit-patches.sh +++ /dev/null @@ -1,13 +0,0 @@ -#!/bin/bash - -FROM="--from=Anna.Schumaker@Netapp.com" -TO="--to=Trond.Myklebust@hammerspace.com" -#TO="--to=bfields@redhat.com --to=chuck.lever@oracle.com" -#TO="--to=fstests@vger.kernel.org" -#TO="--to=steved@redhat.com" - -TO="$TO --to=linux-nfs@vger.kernel.org" - -CC="--cc=Anna.Schumaker@Netapp.com" - -git send-email $FROM $TO $CC $* diff --git a/submit-patches.zsh b/submit-patches.zsh new file mode 100755 index 0000000..aff49ee --- /dev/null +++ b/submit-patches.zsh @@ -0,0 +1,25 @@ +#!/bin/zsh + +zparseopts -D -K \ + -nfs+=WHO -nfsd+=WHO -nfsutils+=WHO -xfstests+=WHO -fstests+=WHO + +if [[ ${#WHO} -eq 0 ]]; then + echo "Who to submit to?" + exit 1 +fi + +TO=(--to=linux-nfs@vger.kernel.org) +for who in $WHO; do + case $who in + --nfs) TO+=(--to=trond.myklebust@hammerspace.com) ;; + --nfsd) TO+=(--to=chuck.lever@oracle.com) ;; + --nfsutils) TO+=(--to=steved@redhat.com) ;; + --xfstests | --fstests) TO+=(--to=fstests@vger.kernel.org) ;; + esac +done + +TO+=(--cc=anna@kernel.org) +TO+=(--from=Anna.Schumaker@Netapp.com) +TO=$(echo ${(u)TO}) + +git send-email $TO $*