~andir/nixpkgs-dev

ml-tools: notmuch-am: include default --add-link arg to b4 v1 PROPOSED

William Casarin: 1
 notmuch-am: include default --add-link arg to b4

 1 files changed, 3 insertions(+), 1 deletions(-)
Hey Matthias,

On Thu, Apr 01, 2021 at 08:51:38PM +0200, Matthias Beyer wrote:
Next
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/21625/mbox | git am -3
Learn more about email & git
View this thread in the archives

[PATCH ml-tools] notmuch-am: include default --add-link arg to b4 Export this patch

In your nixpkgs .git/config:

[b4]
	linkmask = https://lists.sr.ht/~andir/nixpkgs-dev/%%3C%s%%3E

Signed-off-by: William Casarin <jb55@jb55.com>
---

Hey team,

I just added a default `--add-link` b4-am argument to our notmuch-am[1] script.

This automatically adds a Link: trailer to each commit, saving you from
having to amend that manually.

It doesn't look like there's a way to add Message-Id automatically, so
perhaps just the link is fine since it has message-id in it? Would save
you from having to amend any commits which is nice.

Cheers,
Will

[1] http://git.jb55.com/nixpkgs-ml-tools

 notmuch-am | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/notmuch-am b/notmuch-am
index df7f038..fb299be 100755
--- a/notmuch-am
+++ b/notmuch-am
@@ -1,5 +1,7 @@
#!/usr/bin/env bash

B4AM_ARGS=${B4AM_ARGS:-"--add-link"}

usage () {
    printf %s "\
Usage: notmuch-am <thread-id>
@@ -23,7 +25,7 @@ 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"
    b4 am "$B4AM_ARGS" "$msgid" -m "$mbox"
    rm -f "$mbox"
}

-- 
2.30.0
Hi William,

On 30-03-2021 05:50:20, William Casarin wrote: