commit 2520aebac6ee7c126786e9dbb1d086575fb54878
parent 7212160719ea2a80d94b83562a10ecbf28f29095
Author: William Casarin <jb55@jb55.com>
Date: Sun, 4 Apr 2021 10:49:06 -0700
notmuch-am: don't apply add-link by default
Add --add-link option to notmuch-am which will be passed to b4
Signed-off-by: William Casarin <jb55@jb55.com>
Diffstat:
1 file changed, 9 insertions(+), 8 deletions(-)
diff --git a/notmuch-am b/notmuch-am
@@ -134,15 +134,19 @@ assign_positional_args 1 "${_positionals[@]}"
#
# ###
-
-
-B4AM_ARGS=${B4AM_ARGS:-"--add-link"}
+B4AM_ARGS=${B4AM_ARGS:-""}
main () {
mbox=$(mktemp)
notmuch show --format=mbox "$1" > "$mbox"
msgid=$(grep -i ^message-id "$mbox" | cut -d" " -f2 | head -n1)
+ if [[ "$_arg_b4addlink" == "on" ]]; then
+ B4AM_ARGS+=" --add-link"
+ fi
+
+ B4AM_ARGS+=" $msgid"
+
if [[ "$_arg_am" == "on" ]]; then
AM_ARGS=""
if [[ "$_arg_3" == "on" ]]; then
@@ -151,13 +155,10 @@ main () {
if [[ "$_arg_amsignoff" == "on" ]]; then
AM_ARGS+=" --signoff"
fi
- if [[ "$_arg_b4addlink" == "on" ]]; then
- B4AM_ARGS+=" --add-link"
- fi
- b4 am "$B4AM_ARGS" "$msgid" -m "$mbox" -o - | git am $AM_ARGS
+ b4 am $B4AM_ARGS -m "$mbox" -o - | git am $AM_ARGS
else
- b4 am "$B4AM_ARGS" "$msgid" -m "$mbox"
+ b4 am $B4AM_ARGS -m "$mbox"
fi
rm -f "$mbox"