unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
From: Carl Worth <cworth@cworth.org>
To: Johan Parin <johanparin@gmail.com>, notmuch@notmuchmail.org
Subject: Re: [PATCH] Display extra headers for emacs-mua - db config option
Date: Fri, 22 Nov 2019 09:46:19 -0800	[thread overview]
Message-ID: <87mucn3itw.fsf@wondoo.home.cworth.org> (raw)
In-Reply-To: <m21ru0sxl7.fsf@gmail.com>

[-- Attachment #1: Type: text/plain, Size: 2412 bytes --]

On Thu, Nov 21 2019, Johan Parin wrote:
> Johan Parin <johanparin@gmail.com> writes:
>> Daniel Kahn Gillmor <dkg@fifthhorseman.net> writes:
>>>
>>> Is it that much worse to pass around the notmuch_database_t *?

My opinion is that we should not use the static notmuch_database_t
pointer. I think any desire to reach for that is, at best, papering over
some other problem that would be better fixed itself.

>> It has a lot of code impact, it really propagates to a lot of
>> places.
...
> Here is a taste (not fully tested, but seems to work).
...
>  static int
> -do_reply (notmuch_config_t *config,
> +do_reply (notmuch_database_t *notmuch,
> +	  notmuch_config_t *config,

This passing around of the pair of notmuch_database_t* and a
notmuch_config_t* all over the place looks like an anti-pattern to me,
(and something that was just being hidden by the static
notmuch_database_t* that would be better to be fixed properly).

One option for reducing that pair to a single pointer would be to move
the configuration into the database, (as Daniel has been arguing for a
while).

I've argued against that in the past, (and obviously, I came up with the
current approach originally). But the historical situation has already
led to some unpleasant mixing of configuration state, (where some state
is in the configuration file and other state is in the database and it's
hard to predict which is where and which things can be controlled in the
configuration file).

And I think a patch like the above with the "notmuch, config" all over
the place would be another unpleasant result of the historical
convention.

So, I wouldn't be opposed to having the configuration move into the
database entirely. I would definitely like to see a tool that allows for
a dump/restore operation of the configuration state, (so users can still
edit configuration parameters with a text editor and with
fully-documented parameters). Bonus points if the users can also capture
their own commentary/explanation of values they are setting (as they can
do with the current configuration file).

And if things do move, existing configuration files should be updated
with a comment describing what that new dump/restore mechanism is and
that the current configuration file will no longer be used, (though, at
the transition point, obviously configuration parameters should be
copied from the configuration file into the database).

-Carl

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 832 bytes --]

  parent reply	other threads:[~2019-11-22 17:46 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-16 16:27 [PATCH] Display extra headers for emacs-mua - db config option Johan Parin
2019-11-16 16:35 ` Tomi Ollila
2019-11-16 16:53 ` Johan Parin
2019-11-21  2:48 ` Daniel Kahn Gillmor
2019-11-21 12:16   ` David Bremner
2019-11-21 18:29   ` Johan Parin
2019-11-21 21:56     ` Johan Parin
2019-11-22  2:51       ` Daniel Kahn Gillmor
2019-11-22 17:46       ` Carl Worth [this message]
2019-11-21 12:27 ` David Bremner
2019-11-21 19:47   ` Daniel Kahn Gillmor
2019-11-21 21:38     ` Tomi Ollila
2019-11-22  2:43       ` moving the config into the database [was: Re: [PATCH] Display extra headers for emacs-mua - db config option] Daniel Kahn Gillmor
2019-12-08 16:47         ` Jorge P. de Morais Neto
2019-12-08 17:12           ` Jameson Graef Rollins
2019-12-08 18:19             ` Jorge P. de Morais Neto
2019-12-09 18:31               ` Daniel Kahn Gillmor
2019-12-10 12:46                 ` Jorge P. de Morais Neto
2019-12-10 17:01                   ` Daniel Kahn Gillmor
2019-12-12 11:59                     ` Jorge P. de Morais Neto
2019-12-10 16:11               ` Jameson Graef Rollins
2019-12-11 10:53                 ` David Edmondson
2019-12-11 14:00                   ` David Bremner
2019-12-11 14:21                     ` David Edmondson
2019-12-12 16:25                     ` Daniel Kahn Gillmor

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=87mucn3itw.fsf@wondoo.home.cworth.org \
    --to=cworth@cworth.org \
    --cc=johanparin@gmail.com \
    --cc=notmuch@notmuchmail.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).