Re: [PATCH] CLI/restore: handle missing keys and values in config data.

Subject: Re: [PATCH] CLI/restore: handle missing keys and values in config data.

Date: Sat, 17 Feb 2018 21:05:43 -0800

To: Tomi Ollila, David Bremner, notmuch@notmuchmail.org

Cc:

From: Daniel Kahn Gillmor


On Thu 2018-02-15 07:53:11 +0200, Tomi Ollila wrote:
> But to emphasize my desire (where I can contribute to) and something
> Carl was worried at that we'd lose capability to edit configuration
> file with an editor I think we sould have a way to export the configuration
> to easily editable file and then import it after modifications.

fwiw, if the config file went away, i think a bare-bones implemention
could be done using something like vipe (from the moreutils package):

    notmuch dump --include=config | vipe | notmuch restore

but i have not tested it heavily! :) (one additional problem here might
be the race for the lock; if the tail of the pipeline is initialized
first, and it grabs a read/write lock on the notmuch db, it might block
the head of the pipeline, but a less-bare-bones implementation doesn't
need to be strictly a shell pipeline)

What's missing in this trivial implementation is:

 a) if a config variable is deleted from the interstitial editor, it is
    not removed from the database config (though we currently have no
    way to clear variables from the database either)

 b) comments added by the user will be thrown away

As i said on IRC, i think preserving user comments while still
facilitating automated/programmatic access to the variables in question
is the stickiest part of trying to make a human-editable file that maps
to these configuration variables.

I'm not convinced that the complexity is worth the tradeoff, but i
wouldn't object to it if someone has a clear vision and wants to
implement it.

   --dkg
signature.asc (application/pgp-signature)
_______________________________________________
notmuch mailing list
notmuch@notmuchmail.org
https://notmuchmail.org/mailman/listinfo/notmuch

Thread: