In your nixpkgs .git/config:
linkmask = https://lists.sr.ht/~andir/nixpkgs-dev/%%3C%s%%3E
Signed-off-by: William Casarin <firstname.lastname@example.org>
I just added a default `--add-link` b4-am argument to our notmuch-am 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.
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 @@
So, as far as I can see, this _always_ adds the --add-link flag to the b4 call,
am I right? Because if I do not have that setting in my git configuration,
that'll break (because it will use the kernel lore to link the commit, which
obviously doesn't work).
Maybe we could check if there is such a setting in the git configuration and if
there's not, simply not allow that flag to be passed to b4?
Yup we could also just set the config automatically. These tools are
just for nixpkgs-dev maintainers for now so I don't think it would be a
huge problem to have the script set the config if we don't have it:
agreed, I was using it for non-nixpkgs (the ml-tools repo itself) and
realized I didn't have the linkmask set. I removed the --add-link
default. It's now an option that you pass to notmuch-am.
I know this is not intended, of course. But adding such a feature would just
artificially make it hard for non-nixpkgs usecases.
I'd rather have a note in the README for the repository that this should be
added and the tool simply not add the `--add-link` flag for b4.
Setting the linkmask in the config for the repository is a one-time effort.
We could even echo a warning that `--add-link` is not added because the linkmask
is not set, making it visible to the user that there is this setting (for users
who do not care to read the README :D ).
linkmask=$(git config --local b4.linkmask)
if [ -z "$linkmask" ]; then
git config --local b4.linkmask 'https://lists.sr.ht/~andir/nixpkgs-dev/%%3C%s%%3E'
If we want a more general tool like the one you mentioned for the other
thread, that's out of scope for the nixpkgs-ml-tools repo.
It's not too hard, the tools works for mboxes just fine. The network
access bit is a bit annoying, and a simpler tool would be ideal, but
it's not a battle I care about waging right now since b4 works well