diff options
author | Jakub Kicinski <kuba@kernel.org> | 2020-11-06 09:31:48 -0800 |
---|---|---|
committer | Daniel Borkmann <daniel@iogearbox.net> | 2020-11-09 22:06:45 +0100 |
commit | c1040237c3f55588988bac944244f9cf310e9a86 (patch) | |
tree | ede2d2c2b0cfc54fd146bacaafc8c99ff686f154 | |
parent | 8d9dfabbb27f7c98758852f4e9399b541cf9370c (diff) | |
download | pw-c1040237c3f55588988bac944244f9cf310e9a86.tar.gz |
pw-apply: make mb2q optional
I don't like how mb2q reshuffles tags so allow opt out.
To still get lore links use the method described in kernel's
Documentation/ - ask git am to preserve message id, and have
a git hook rewrite them into links.
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
-rwxr-xr-x | pw-apply | 19 |
1 files changed, 16 insertions, 3 deletions
@@ -6,8 +6,8 @@ usage() { cat <<-EOF - usage: pw-apply [-h] [-s SERIES] [-b MBOX] [-m BRANCHNAME] [-a] [-3] -- [-C] - [-a ACKEDBY] [-r REVIEWEDBY] [-t TESTEDBY] + usage: pw-apply [-h] [-s SERIES] [-b MBOX] [-m BRANCHNAME] [-a] [-3] [-N] + -- [-C] [-a ACKEDBY] [-r REVIEWEDBY] [-t TESTEDBY] EOF exit } @@ -57,12 +57,14 @@ accept="" merge="" mbox="" cover="" +mb2q_normalize="y" head_old=$(git rev-parse --verify HEAD) while true; do case "$1" in -3 ) git_am_flags="$git_am_flags -3" ;; -s | --series ) series="$2"; shift 2 ;; -a | --accept ) accept="1"; shift ;; + -N | --no-mb2q ) mb2q_normalize=""; shift ;; -m | --merge ) merge="1"; branch="$2"; shift 2 ;; -b | --mbox ) mbox="$2"; shift 2 ;; -c | --cover) branch="tmp"; cover="$2"; shift 2 ;; @@ -79,8 +81,19 @@ done [ ! -z "$accept" ] && accept_series $series [ ! -z "$cover" ] && cover_from_url $cover git checkout -b $branch -mb2q --mboxout mbox.o "$@" mbox.i + +if [ ! -z "$mb2q_normalize" ]; then + mb2q --mboxout mbox.o "$@" mbox.i +else + cp mbox.i mbox.o +fi + +flags=$git_am_flags +# When running without mb2q ask git-am for msgid, and have a git hook +# transform that into a lore Link. +[ -z "$mb2q_normalize" ] && flags="$flags -m" git am $git_am_flags mbox.o + git checkout master if [ ! -z "$merge" ]; then git merge --stat --log --no-edit --no-ff $branch |