From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id CPtAAnoBZGKgaQEAbAwnHQ (envelope-from ) for ; Sat, 23 Apr 2022 15:39:06 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id GHpiAXoBZGKhYQEAG6o9tA (envelope-from ) for ; Sat, 23 Apr 2022 15:39:06 +0200 Received: from mail.notmuchmail.org (yantan.tethera.net [IPv6:2a01:4f9:c011:7a79::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id C466214F20 for ; Sat, 23 Apr 2022 15:39:05 +0200 (CEST) Received: from yantan.tethera.net (localhost [127.0.0.1]) by mail.notmuchmail.org (Postfix) with ESMTP id 299C25F75B; Sat, 23 Apr 2022 13:39:02 +0000 (UTC) Received: from fethera.tethera.net (fethera.tethera.net [198.245.60.197]) by mail.notmuchmail.org (Postfix) with ESMTP id 2F93D5F756 for ; Sat, 23 Apr 2022 13:38:59 +0000 (UTC) Received: by fethera.tethera.net (Postfix, from userid 1001) id 3FE205FBD7; Sat, 23 Apr 2022 09:38:58 -0400 (EDT) Received: (nullmailer pid 3856535 invoked by uid 1000); Sat, 23 Apr 2022 13:38:56 -0000 From: David Bremner To: notmuch@notmuchmail.org Subject: WIP: promote nmbug to user sync tool Date: Sat, 23 Apr 2022 10:38:32 -0300 Message-Id: <20220423133848.3852688-1-david@tethera.net> X-Mailer: git-send-email 2.35.2 MIME-Version: 1.0 Message-ID-Hash: N5746LBQAXNBWVWJYC2XHRD6KQPTMYU3 X-Message-ID-Hash: N5746LBQAXNBWVWJYC2XHRD6KQPTMYU3 X-MailFrom: bremner@tethera.net X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-notmuch.notmuchmail.org-0; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.3 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Migadu-Flow: FLOW_IN X-Migadu-To: larch@yhetil.org X-Migadu-Country: DE ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1650721145; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding:list-id:list-help: list-owner:list-unsubscribe:list-subscribe:list-post; bh=mcpJevBbIeH3ruY0+7eiQ1Pqlf8lqBHN/2OL7IYHiCA=; b=oaqABoEWJ2+iym6erBcD1B36nd8GsPrdDapHcqDlK8HeMT0Df5d/8UX85tGXHnWs+InACY 6HVFiJlIkbgGemRZRqZNgrVpY35+DIrVUKRLITxDLUfHbXAWUNF1FG0uzQo/z+fxWYZeFi J0gO6kNsTZwW92gbe5js937V65TpuEyQnY9WaUTF9pe5yg11CfPNAczzO98MN/oMdwKxGy DZHOZFbD4LT0MdOsmLsS+g+lDriS+vTV4pqUtLlmKrM72CPcYUeL+G6nyypFSUsZcLqapk 9H0p/yAHxbCwyrSCYQJ06qRZ42vs1Xtryxn/8Yegtj3rc8yrw1gJ1Qr1nX5IIQ== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1650721145; a=rsa-sha256; cv=none; b=WhHRAgEj8aw2ffHykQXbQfKDq27Ri+DT1N7ioQr4QV/Hhr2yv5BM1o6qSbsqCNPj6TSY9b hDkbHN3CVp8LxElfw50aMV6rV13QXQcXPBLkRNhIQx4OdpiJ25pIg5h5vXx7XSfg5Xj8cc oVPeHjLo1Am7FdQ4vg9cCVNp4dEgzbtOzlikvCZZb3oPIb40Lfpq1O+GDzU8GRPOkwxcml eZD5BxXaC5UvFkQTZHicW583uhVqPGf4Rd+3nJdpaIy3XsxGZVptO7CaWutPyFwQGhtoye 4zspdTPzehfw/jtDFZ2KPWDDHe+0gL+e9ZR4+4xvG2BN6osuDMHexDhS2irOTA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of notmuch-bounces@notmuchmail.org designates 2a01:4f9:c011:7a79::1 as permitted sender) smtp.mailfrom=notmuch-bounces@notmuchmail.org X-Migadu-Spam-Score: -0.03 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of notmuch-bounces@notmuchmail.org designates 2a01:4f9:c011:7a79::1 as permitted sender) smtp.mailfrom=notmuch-bounces@notmuchmail.org X-Migadu-Queue-Id: C466214F20 X-Spam-Score: -0.03 X-Migadu-Scanner: scn1.migadu.com X-TUID: g3Sp/uzc08UR One of the things that new (and old) users of notmuch often miss is a way to sync tags between hosts. muchsync exists, but it's a third party tool, and (if I understand correctly) it directly modifies the notmuch database. Meanwhile we ship a moderately complex python script called 'nmbug' which can be used to sync arbitrary tags between hosts. This series is my (first pass at an) attempt to promote nmbug to a notmuch subcommand "notmuch git". My plan is to replace my own homebrew "commit notmuch dump output to git" script with this new command; I think it may appeal to other users as well. As a bonus, it provides a simple (for the user) way to do incremental backups of the notmuch database. I had to add a couple of caching tricks to make the script usable for my database, but it is now reasonably fast (say 20s) to commit a days worth of changes on my machine. There are still some rough edges, mainly due to the heritage of the script. Some I am aware of include: - the (new) man page is inadequate - notmuch git doesn't understand the common arguments to notmuch (--config and friends) - the defaults for prefix and git repo are wrong for most users. I was thinking about either a --nmbug argument to set the old defaults, or having the script recognize if it is invoked as nmbug. - There are a few too many global variables - I just remembered, MAX_LASTMOD is unused, leftover from a previous design for querying tags. One thing that not everyone will like is that this requires sexp queries in your version of notmuch. It's exactly the kind of application I had in mind when I built the sexp query parser (script generated queries), and the sexp queries actually allow fixing an escaping bug in the current nmbug