unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
From: Michael J Gruber <git@grubix.eu>
To: "David Bremner" <david@tethera.net>,
	"Uwe Kleine-König" <uwe@kleine-koenig.org>,
	notmuch@notmuchmail.org
Subject: Re: setting NOTMUCH_CONFIG in hooks
Date: Tue, 27 Apr 2021 15:03:46 +0200	[thread overview]
Message-ID: <161952862603.12126.11881406139322293484.git@grubix.eu> (raw)
In-Reply-To: <87fszbsy7d.fsf@tethera.net>

David Bremner venit, vidit, dixit 2021-04-27 14:34:30:
> Uwe Kleine-König <uwe@kleine-koenig.org> writes:
> 
> > Hello,
> >
> > when I run
> >
> >       notmuch --config=$HOME/.notmuch-config-work new
> >
> > NOTMUCH_CONFIG isn't set when the hooks are running. This would however
> > be quite useful such that e.g. afew uses the right database. Of course I
> > could do
> >
> >       NOTMUCH_CONFIG=$HOME/.notmuch-config-work notmuch new
> >
> > instead, but then it would be consequent to drop the --config option
> > from notmuch completely :-)
> >
> 
> It's not the same thing, but seems to relate to your use case. There is
> some new and mostly untested support for a "NOTMUCH_PROFILE" environment
> variable that might help. Or it might have the same issue with
> propagation to hooks. See notmuch-config(1) in master / 0.32~rc1.

Note that a typical use case for a post hook is `notmuch tag` (not just
in the disguise of `afew`), and it is essential that it runs against the
same db and config as the notmuch which is calling the hook.

So, either notmuch should export `NOTMUCH_CONFIG` into the environment
which it runs the hooks in (if overriden by `--config`), or, as Uwe
suggests, and in the light of other variables like `NOTMUCH_PROFILE`,
`--config` could be deprecated so that users automatically do "the right
thing". Seems to be more future proof.

Regards
Michael

  reply	other threads:[~2021-04-27 13:03 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-03  6:24 setting NOTMUCH_CONFIG in hooks Uwe Kleine-König
2020-06-03 14:12 ` David Bremner
2021-04-27 12:34 ` David Bremner
2021-04-27 13:03   ` Michael J Gruber [this message]
2021-08-28 14:49     ` David Bremner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://notmuchmail.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=161952862603.12126.11881406139322293484.git@grubix.eu \
    --to=git@grubix.eu \
    --cc=david@tethera.net \
    --cc=notmuch@notmuchmail.org \
    --cc=uwe@kleine-koenig.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://yhetil.org/notmuch.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).