--- /dev/null
+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 arlo.cworth.org (Postfix) with ESMTP id CA5266DE00E1\r
+ for <notmuch@notmuchmail.org>; Mon, 11 Apr 2016 15:41:35 -0700 (PDT)\r
+X-Virus-Scanned: Debian amavisd-new at cworth.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: -0.02\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=-0.02 tagged_above=-999 required=5 tests=[AWL=-0.020]\r
+ autolearn=disabled\r
+Received: from arlo.cworth.org ([127.0.0.1])\r
+ by localhost (arlo.cworth.org [127.0.0.1]) (amavisd-new, port 10024)\r
+ with ESMTP id ZC2-Sq2unO6R for <notmuch@notmuchmail.org>;\r
+ Mon, 11 Apr 2016 15:41:27 -0700 (PDT)\r
+Received: from che.mayfirst.org (che.mayfirst.org [162.247.75.118])\r
+ by arlo.cworth.org (Postfix) with ESMTP id 4D8846DE00BB\r
+ for <notmuch@notmuchmail.org>; Mon, 11 Apr 2016 15:41:27 -0700 (PDT)\r
+Received: from fifthhorseman.net (unknown [38.109.115.130])\r
+ by che.mayfirst.org (Postfix) with ESMTPSA id 2DC80F991;\r
+ Mon, 11 Apr 2016 18:41:25 -0400 (EDT)\r
+Received: by fifthhorseman.net (Postfix, from userid 1000)\r
+ id BB74E1FFD1; Mon, 11 Apr 2016 18:41:24 -0400 (EDT)\r
+From: Daniel Kahn Gillmor <dkg@fifthhorseman.net>\r
+To: David Bremner <david@tethera.net>, Notmuch Mail <notmuch@notmuchmail.org>\r
+Subject: Re: thread merge/split proposal\r
+In-Reply-To: <878u0l8uyv.fsf@zancas.localnet>\r
+References: <87mvp9uwi4.fsf@alice.fifthhorseman.net>\r
+ <87k2kdutao.fsf@alice.fifthhorseman.net> <878u0l8uyv.fsf@zancas.localnet>\r
+User-Agent: Notmuch/0.21+124~gbf604e9 (http://notmuchmail.org) Emacs/24.5.1\r
+ (x86_64-pc-linux-gnu)\r
+Date: Mon, 11 Apr 2016 18:41:21 -0400\r
+Message-ID: <87egabu5ta.fsf@alice.fifthhorseman.net>\r
+MIME-Version: 1.0\r
+Content-Type: multipart/signed; boundary="=-=-=";\r
+ micalg=pgp-sha512; protocol="application/pgp-signature"\r
+X-BeenThere: notmuch@notmuchmail.org\r
+X-Mailman-Version: 2.1.20\r
+Precedence: list\r
+List-Id: "Use and development of the notmuch mail system."\r
+ <notmuch.notmuchmail.org>\r
+List-Unsubscribe: <https://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: <https://notmuchmail.org/mailman/listinfo/notmuch>,\r
+ <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
+X-List-Received-Date: Mon, 11 Apr 2016 22:41:35 -0000\r
+\r
+--=-=-=\r
+Content-Type: text/plain\r
+\r
+On Sun 2016-04-10 09:16:40 -0400, David Bremner wrote:\r
+> Daniel Kahn Gillmor <dkg@fifthhorseman.net> writes:\r
+>\r
+>> for (1) i'd propose that the join operation would be implemented by\r
+>> adding a new term type "join", which can be applied to any document.\r
+>> Its value is the message-id of a message that *should* be "in-reply-to"\r
+>> but wasn't.\r
+>\r
+> Having "split" terms or equivalently "signed" +-reference terms would\r
+> allow more general thread splitting, effectively updating (via a little\r
+> journal of additions and deletions) the references data stored in mail\r
+> file.\r
+\r
+I'm not sure what you mean by "signed" here (cryptographically signed?\r
+a term named "signed"? the idea that the term could be either positive\r
+or negative?), but i think your proposal is that we could have a\r
+"reference" term with a value of "+foo@example.com" or\r
+"-foo@example.com", instead of having a "join" term with value\r
+"foo@example.com" and a "split" term with value "foo@example.com"\r
+\r
+I'm not sure i see much of a difference between\r
+\r
+ a) introduce two new term types, "join" and "split", with unsigned\r
+ values\r
+\r
+and\r
+\r
+ b) introduce one new term type, "reference" with signed values\r
+\r
+> The implementation cost could not be that much higher than only\r
+> join/unjoin; a bit more work managing the terms attached to a document\r
+> to avoid contradictions.\r
+\r
+right -- and we'd need an understanding of the order in which these\r
+terms are applied if multiple possibly-conflicting terms are present.\r
+\r
+> Both versions probably complicate some peoples syncing solutions.\r
+\r
+both (a) and (b) complicate syncing solutions, but my original proposal\r
+of:\r
+\r
+ c) just introduce a new term type "join" with unsigned value\r
+\r
+is easy to sync, i think; i was going for the low-hanging fruit, and\r
+trying to not let it get caught up on the more-fully-featured\r
+arbitrary-split use case, though i understand the appeal of the generic\r
+approach.\r
+\r
+fwiw, i can do a really nasty workaround today to implement "join"\r
+between two messages:\r
+\r
+#### notmuch-join:\r
+--------------\r
+#!/bin/bash\r
+\r
+verify_exists() {\r
+ if ! notmuch search --output=files id:"$1" | grep -q . ; then\r
+ printf "message-id %s is not in your messages\n" "$1" >&2\r
+ exit 1\r
+ fi\r
+}\r
+\r
+verify_exists "$1"\r
+verify_exists "$2"\r
+\r
+jdir=$(notmuch config get database.path)/join\r
+mkdir -p "$jdir"\r
+z=$(mktemp "$jdir/join.XXXXXX")\r
+\r
+cat >"$z" <<EOF\r
+From: test@example.org\r
+Date: $(date -R)\r
+Message-Id: <$(uuidgen)@join.example.org>\r
+References: <$1>, <$2>\r
+Subject: join\r
+\r
+test\r
+EOF\r
+notmuch new\r
+rm "$z"\r
+notmuch new\r
+--------------\r
+\r
+And i note that this change is also not synced across dump/restore.\r
+\r
+So adding an explicit "join" document term (and figuring out how to\r
+represent it in "notmuch dump" and "notmuch restore") would be a strict\r
+improvement over the current situation, right?\r
+\r
+ --dkg\r
+\r
+\r
+--=-=-=\r
+Content-Type: application/pgp-signature; name="signature.asc"\r
+\r
+-----BEGIN PGP SIGNATURE-----\r
+Version: GnuPG v2\r
+\r
+iQJ8BAEBCgBmBQJXDCgRXxSAAAAAAC4AKGlzc3Vlci1mcHJAbm90YXRpb25zLm9w\r
+ZW5wZ3AuZmlmdGhob3JzZW1hbi5uZXRFREIyRTc0RjU2RkNGMkI2NzI5N0I3MzUy\r
+NEVDRkY1QUZGNjgzNzBBAAoJECTs/1r/aDcK8RoQAI82FInuseffZAQKXaHgU5Gm\r
+sRq9qytGeqRp0/AQybpYgol5B9JEcB1LoAwpU3ka3CUy6mt4adeABpwnGLgG2bhR\r
+oXcD4aT+uiczA9L1E4mipWBAAD0cVfd69zvcU+yF116Gc2FNzE+eNZJ4M+UAEdGc\r
+o4Vl8wQVCCxcU9COrtvRSGY5+Z6kc5w/iKH7jOmLCCZsREVT4RXwks7jqUziep17\r
+TJDZB62X0f1ZYvcPGrPEvgvlTfdyi+Pt/WvOPrMen6Q6HDAnzhfsruftCANonvyw\r
+ROnXHXt7C0Co6AKcB7y33sACk6+8cMreUh2x9ty8Ih9epp580LVg0NudcYwB4pHa\r
+C0Zc233ou9z9hMT02jO+C6fxb37yqQJXb4IMfj3Xk8lXstH09Xt1+1jD6Dmo701e\r
+iSLn+DCNymvw+gziJy/lzyuMO2EVdvVjW0Qw0EejOwPIxcTcQJuU5PaR7CxFkZyS\r
+XQ8KgZ6kvgyvlaOV3PF51dwhYVF64eZ/LGuysB3IsQZ0DTOrdMF/o0cAumosaUmb\r
+OOMJ/3xLa6lCN+mUIvn0HQOu+8SBPodbvb2oWmVbC9zqjpd0yJ4FAKd6xBcVQPm4\r
+gMSwPvTW1ATUofDUM1KkGp8HKSbuacxDVZZdD+cOG7PVrsTsy+ubkXWarMIr0xhf\r
+hK+B8KNhQgbrUNrN1rBo\r
+=Gkgo\r
+-----END PGP SIGNATURE-----\r
+--=-=-=--\r