From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by arlo.cworth.org (Postfix) with ESMTP id 928716DE01F6 for ; Sun, 18 Feb 2018 00:49:56 -0800 (PST) X-Virus-Scanned: Debian amavisd-new at cworth.org X-Spam-Flag: NO X-Spam-Score: 0 X-Spam-Level: X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[none] autolearn=disabled Received: from arlo.cworth.org ([127.0.0.1]) by localhost (arlo.cworth.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id UhnUcTJZt1Ci for ; Sun, 18 Feb 2018 00:49:54 -0800 (PST) Received: from che.mayfirst.org (che.mayfirst.org [162.247.75.118]) by arlo.cworth.org (Postfix) with ESMTPS id 76BEB6DE01E8 for ; Sun, 18 Feb 2018 00:49:54 -0800 (PST) Received: from fifthhorseman.net (ip174-65-50-221.sd.sd.cox.net [174.65.50.221]) by che.mayfirst.org (Postfix) with ESMTPSA id 26AE8F99A; Sun, 18 Feb 2018 03:49:50 -0500 (EST) Received: by fifthhorseman.net (Postfix, from userid 1000) id 02622214CF; Sun, 18 Feb 2018 00:05:46 -0500 (EST) From: Daniel Kahn Gillmor To: Tomi Ollila , David Bremner , notmuch@notmuchmail.org Subject: Re: [PATCH] CLI/restore: handle missing keys and values in config data. In-Reply-To: References: <20180107213025.12848-1-david@tethera.net> <87zi5p8dtw.fsf@fifthhorseman.net> <87r2r1jjj5.fsf@tethera.net> <87r2put8aq.fsf@fifthhorseman.net> Date: Sat, 17 Feb 2018 21:05:43 -0800 Message-ID: <87y3jqlwew.fsf@fifthhorseman.net> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Feb 2018 08:49:56 -0000 --=-=-= Content-Type: text/plain 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 --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEARYKAB0WIQTTaP514aqS9uSbmdJsHx7ezFD6UwUCWokJqAAKCRBsHx7ezFD6 U73NAP4wcXtpiNPSWYCrY4TyQHR3NGyDxdkqOOJKAE6fLqdEqQEArzLJi0V4joRW lxO5fyBXlf7eXHdIroIcHEYznGPEMgQ= =Agfg -----END PGP SIGNATURE----- --=-=-=--