~andir/nixpkgs-dev

ml-tools: notmuch-am: Add brief usage instructions v1 PROPOSED

Xinglu Chen: 1
 notmuch-am: Add brief usage instructions

 1 files changed, 28 insertions(+), 5 deletions(-)
Export patchset (mbox)
How do I use this?

Copy & paste the following snippet into your terminal to import this patchset into git:

curl -s https://lists.sr.ht/~andir/nixpkgs-dev/patches/20152/mbox | git am -3
Learn more about email & git
View this thread in the archives

[PATCH ml-tools] notmuch-am: Add brief usage instructions Export this patch

Most people who haven't followed the messages in the nixpkgs-dev
mailing lists probably won't know how this was intended to be used.
Signed-off-by: Xinglu Chen <public@yoctocell.xyz>
---
 notmuch-am | 33 ++++++++++++++++++++++++++++-----
 1 file changed, 28 insertions(+), 5 deletions(-)

diff --git a/notmuch-am b/notmuch-am
index 3e0fe71..b3af007 100755
--- a/notmuch-am
+++ b/notmuch-am
@@ -1,7 +1,30 @@
#!/usr/bin/env bash

mbox=$(mktemp)
notmuch show --format=mbox "$1" > "$mbox"
msgid=$(grep -i ^message-id "$mbox" | cut -d" " -f2 | head -n1)
b4 am "$msgid" -m "$mbox"
rm -f "$mbox"
usage () {
    printf %s "\
Usage: notmuch-am <thread-id>

Use b4 to apply a patchset from a thread.

Example
  
  $ notmuch-am thread:000000000001b70e
  Analyzing 6 messages in the thread
  ---
  Writing ./20210206_jb55_b4_init_at_0_6_2.mbx
    [PATCH] b4: init at 0.6.2
      + Reviewed-by: Xinglu Chen <public@yoctocell.xyz> (✓ DKIM/yoctocell.xyz)
      + Reviewed-by: Matthias Beyer <mail@beyermatthias.de>
"
exit 0
}

main () {
    mbox=$(mktemp)
    notmuch show --format=mbox "$1" > "$mbox"
    msgid=$(grep -i ^message-id "$mbox" | cut -d" " -f2 | head -n1)
    b4 am "$msgid" -m "$mbox"
    rm -f "$mbox"
}

[ -n "$1" ] || usage && main "$@"

base-commit: 3309cfeb79dc78b3a51498f673023d2b6a0e210e
-- 
2.30.0
Thanks!

pushed

To http://git.jb55.com/nixpkgs-ml-tools
   3309cfe..fdc1835  master -> master
 
Tested-by: Matthias Beyer <mail@beyermatthias.de>