Re: `notmuch setup` replaces `~/.notmuch-config` instead of truncating it
authorDaniel Kahn Gillmor <dkg@fifthhorseman.net>
Tue, 16 Nov 2010 20:37:29 +0000 (15:37 +1900)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:37:32 +0000 (09:37 -0800)
fd/bed2df049011d12f5625ddaf181326d0f4c85b [new file with mode: 0644]

diff --git a/fd/bed2df049011d12f5625ddaf181326d0f4c85b b/fd/bed2df049011d12f5625ddaf181326d0f4c85b
new file mode 100644 (file)
index 0000000..89300b5
--- /dev/null
@@ -0,0 +1,125 @@
+Return-Path: <dkg@fifthhorseman.net>\r
+X-Original-To: notmuch@notmuchmail.org\r
+Delivered-To: notmuch@notmuchmail.org\r
+Received: from localhost (localhost [127.0.0.1])\r
+       by olra.theworths.org (Postfix) with ESMTP id 1B2BC40DAE5\r
+       for <notmuch@notmuchmail.org>; Tue, 16 Nov 2010 12:37:47 -0800 (PST)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: -1.899\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=-1.899 tagged_above=-999 required=5\r
+       tests=[BAYES_00=-1.9, UNPARSEABLE_RELAY=0.001] autolearn=ham\r
+Received: from olra.theworths.org ([127.0.0.1])\r
+       by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
+       with ESMTP id 5-CV3VshMTNC for <notmuch@notmuchmail.org>;\r
+       Tue, 16 Nov 2010 12:37:37 -0800 (PST)\r
+Received: from rodolpho.mayfirst.org (rodolpho.mayfirst.org [209.234.253.107])\r
+       (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))\r
+       (No client certificate requested)\r
+       by olra.theworths.org (Postfix) with ESMTPS id F35D240DBFA\r
+       for <notmuch@notmuchmail.org>; Tue, 16 Nov 2010 12:37:36 -0800 (PST)\r
+Received: from localhost (localhost [127.0.0.1])\r
+       by rodolpho.mayfirst.org (Postfix) with ESMTP id 7A70F3CD51;\r
+       Tue, 16 Nov 2010 15:37:34 -0500 (EST)\r
+X-Virus-Scanned: Debian amavisd-new at rodolpho.mayfirst.org\r
+Received: from rodolpho.mayfirst.org ([127.0.0.1])\r
+       by localhost (rodolpho.mayfirst.org [127.0.0.1]) (amavisd-new,\r
+       port 10024)\r
+       with ESMTP id 0F8NQMEZrwfK; Tue, 16 Nov 2010 15:37:34 -0500 (EST)\r
+Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender:\r
+       smtpauth@rodolpho.mayfirst.org) with ESMTPSA id 204E83CD4C\r
+Message-ID: <4CE2EB89.5040209@fifthhorseman.net>\r
+Date: Tue, 16 Nov 2010 15:37:29 -0500\r
+From: Daniel Kahn Gillmor <dkg@fifthhorseman.net>\r
+User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US;\r
+       rv:1.9.2.9) Gecko/20100918 Icedove/3.1.4\r
+MIME-Version: 1.0\r
+To: "Ciprian Dorin, Craciun" <ciprian.craciun@gmail.com>, \r
+       notmuch@notmuchmail.org\r
+Subject: Re: `notmuch setup` replaces `~/.notmuch-config` instead of\r
+       truncating      it\r
+References: <AANLkTikKiKC716H+ddF0Q5T0xc=vGHHOVroLRwzO3ujV@mail.gmail.com>\r
+       <87sjz1dr0j.fsf@yoom.home.cworth.org>\r
+       <AANLkTikrXdp5OOCw2Avs8ao9Ukpq8szsdP9FFZP+eYNK@mail.gmail.com>\r
+In-Reply-To: <AANLkTikrXdp5OOCw2Avs8ao9Ukpq8szsdP9FFZP+eYNK@mail.gmail.com>\r
+X-Enigmail-Version: 1.1.2\r
+OpenPGP: id=D21739E9\r
+Content-Type: multipart/signed; micalg=pgp-sha512;\r
+       protocol="application/pgp-signature";\r
+       boundary="------------enig56E47B72ECF88BC472B23755"\r
+X-BeenThere: notmuch@notmuchmail.org\r
+X-Mailman-Version: 2.1.13\r
+Precedence: list\r
+Reply-To: notmuch <notmuch@notmuchmail.org>\r
+List-Id: "Use and development of the notmuch mail system."\r
+       <notmuch.notmuchmail.org>\r
+List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
+List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
+List-Post: <mailto:notmuch@notmuchmail.org>\r
+List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
+List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
+X-List-Received-Date: Tue, 16 Nov 2010 20:37:47 -0000\r
+\r
+This is an OpenPGP/MIME signed message (RFC 2440 and 3156)\r
+--------------enig56E47B72ECF88BC472B23755\r
+Content-Type: text/plain; charset=UTF-8\r
+Content-Transfer-Encoding: quoted-printable\r
+\r
+On 11/16/2010 03:26 PM, Ciprian Dorin, Craciun wrote:\r
+>     So in the light of the above quoted "glitches", my question is:\r
+> due to the small chance of a power loss happening right when we write\r
+> such a small file, doesn't the inconvenience weight more than the\r
+> (fairly remote probable) file loss?\r
+\r
+What inconvenience?  The inconvenience of writing the code correctly?\r
+that's a small one-time cost compared to *any* risk of a user ending up\r
+with a damaged .notmuch-config (not to mention possible concurrent uses\r
+of notmuch seeing an intermediate version of the file)\r
+\r
+>     P.S.: I say "pseudo" atomic because only the rename is atomic,\r
+> thus in order to override file `a` for the target file `b` which\r
+> exists, we must execute two **non-atomic** operations as a whole, but\r
+> each atomic in part, rename operations: make `b` -> `c`, and then\r
+> rename `a` -> `b`. So there is actually a small time-frame when I can\r
+> be left with two files (`a` and `c`), none of which is my config file\r
+> `b`. (This can be solved when opening the config file by checking if\r
+> there isn't any leftover `c` or `a` file, in which case I take the `a`\r
+> file and complete the rename.)\r
+\r
+There is only one ".notmuch-config" entry in the inode directory that is\r
+your homedir.  it points either to the old file, or the new file.  it\r
+cannot point to both, and it will not point to anything but those two\r
+possibilities.  This is what the atomicity of the operation is expected\r
+to guarantee.\r
+\r
+       --dkg\r
+\r
+\r
+--------------enig56E47B72ECF88BC472B23755\r
+Content-Type: application/pgp-signature; name="signature.asc"\r
+Content-Description: OpenPGP digital signature\r
+Content-Disposition: attachment; filename="signature.asc"\r
+\r
+-----BEGIN PGP SIGNATURE-----\r
+Version: GnuPG v1.4.10 (GNU/Linux)\r
+Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/\r
+\r
+iQIcBAEBCgAGBQJM4uuJAAoJEMzS7ZTSFznp6X8QAIiz2toG3b2OZjq5a8wWF+Ed\r
+wazszczwPnxr9YPiXBTxEPqmAFoInFhoNOt0ebNbo6aiE6G+COeVxRzFjudWx23Q\r
+K1KLPMuGglw1acvmYAr1qsOxM689VVh14txXGRAe5U4dlJ7Pv500tTk0zYmjIvoe\r
+ojAVW+xUgpMTU4H3OaQqGPxZysuG8IGhXdibc3mwvSGrQ/DsxDhSUYiyW8BaEXnH\r
+sIp+ShvV5d8j7Ta6p8N2Q8BXSVQdVNomETZLW+wFvZqPGTsGBT7krB2o3G+ifnLb\r
+Rpd9SUrIs598hZYOMKQJsTc+aCak0sWkBQrD1Kd6XL0ZwR/8MdcEAlTXFxcgiWsm\r
+y5zENJtVEB2rMvubZe5S56nBzII7Mfgk81CJw3DnObtEa6dlb89ZflMdoTQI6Zih\r
+Jx6zPf6oZ1Ogi332+h8or5sVOvuh7N8Wc3rBQ7jNfNqeTl5OYoPSAjte5fpLrElE\r
+62nfTdsUOQ2I9FPXkQm0F86U0rm+mzVVSVBwDD0+jx6d1r4e1QzGoJlUdvSQE6CA\r
+XN5qTyG2g0Kln1TP3qmwDaPcoK8AkmW+8BSWSUc6jZCITlDT2bYvfIfhVKcKQPtH\r
+hnSf20vvkczs/nrkC5gUgmEP47EX+Dwl/KqZMq3/IrYe3ngXdvlCN05O29tptM9f\r
+t083v+6uxr8dzwtwkVI/\r
+=1AhV\r
+-----END PGP SIGNATURE-----\r
+\r
+--------------enig56E47B72ECF88BC472B23755--\r