Re: post-tag hook?
authorDaniel Schoepe <daniel@schoepe.org>
Wed, 10 Jun 2015 22:42:36 +0000 (00:42 +0200)
committerW. Trevor King <wking@tremily.us>
Sat, 20 Aug 2016 21:49:01 +0000 (14:49 -0700)
90/dc6fad1a408d449ff9a570216544d74261636d [new file with mode: 0644]

diff --git a/90/dc6fad1a408d449ff9a570216544d74261636d b/90/dc6fad1a408d449ff9a570216544d74261636d
new file mode 100644 (file)
index 0000000..28d379d
--- /dev/null
@@ -0,0 +1,109 @@
+Return-Path: <daniel@schoepe.org>\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 B57D46DE0948\r
+ for <notmuch@notmuchmail.org>; Wed, 10 Jun 2015 15:42:57 -0700 (PDT)\r
+X-Virus-Scanned: Debian amavisd-new at cworth.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: -0.821\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=-0.821 tagged_above=-999 required=5\r
+ tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1,\r
+ RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=-0.01,\r
+ RCVD_IN_MSPIKE_WL=-0.01, SPF_PASS=-0.001] 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 q0Mw8RuBy8ay for <notmuch@notmuchmail.org>;\r
+ Wed, 10 Jun 2015 15:42:55 -0700 (PDT)\r
+Received: from mail-la0-f50.google.com (mail-la0-f50.google.com\r
+ [209.85.215.50])\r
+ by arlo.cworth.org (Postfix) with ESMTPS id 494076DE0244\r
+ for <notmuch@notmuchmail.org>; Wed, 10 Jun 2015 15:42:54 -0700 (PDT)\r
+Received: by labko7 with SMTP id ko7so41859176lab.2\r
+ for <notmuch@notmuchmail.org>; Wed, 10 Jun 2015 15:42:50 -0700 (PDT)\r
+DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=schoepe.org; s=google;\r
+ h=from:to:cc:subject:in-reply-to:references:user-agent:date\r
+ :message-id:mime-version:content-type;\r
+ bh=mo09+uhKu9v2NEmimUFPbQ0HKdIzFHSktYmuO5fOEiA=;\r
+ b=NO2pAWXptQdUQw45jtHRPmRYtjJnJVS7FoX72jMg4PKtPzVpCsCFwQ1kJr6zp2amJF\r
+ 0GgOA4/FHjUZpP5Rn3SC8yhZ6ay4drv1f/exVdWLx0mdA37wgtOVYk9I4Pqc4FFHeqIV\r
+ eyLfaykT1dZDvBVONKLLvpZ8GeVQMMGv2HhSY=\r
+X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;\r
+ d=1e100.net; s=20130820;\r
+ h=x-gm-message-state:from:to:cc:subject:in-reply-to:references\r
+ :user-agent:date:message-id:mime-version:content-type;\r
+ bh=mo09+uhKu9v2NEmimUFPbQ0HKdIzFHSktYmuO5fOEiA=;\r
+ b=cGxROgrQcq7nWCRZ7mz4je0GMte1QzlyDhWrWVr0V4b2JklBeE68ZxQXAsi90xBVLE\r
+ diBp3C93vTkNpvvO6/viJXxZdkRJZbt5W/sKrpjwoiP3xOon0QzFXT73yJnJtldWHMAW\r
+ 0CuSbb7tGueiiqc4uKr608nPlFoYpnvpRHqIcy4NUVjzqDXyRt8H7S0lOPdF5zAH5FAg\r
+ j1KfrKX80SL4gR9+gFKjfR4GyBn5yYfUhJc5oZdQmaoCa8fTUfF/790YB5r4FLSrVWLQ\r
+ yiTSYGR373Rb6UBgB6KyU59BLUzpQBl2fzvxfU21ANnGDLzQ5AbkyX3+Yx/4p+iqfhkM\r
+ aWXQ==\r
+X-Gm-Message-State:\r
+ ALoCoQk1OCIHLv0c6MSXK5eyAuTy3k7Kv8zRym3FM0ofGlA7OhK2rIR1I8T1Onkt810bkb4YqitY\r
+X-Received: by 10.112.140.231 with SMTP id rj7mr6505105lbb.76.1433976169991;\r
+ Wed, 10 Jun 2015 15:42:49 -0700 (PDT)\r
+Received: from localhost ([91.103.36.37])\r
+ by mx.google.com with ESMTPSA id rg6sm2541924lbb.23.2015.06.10.15.42.48\r
+ (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);\r
+ Wed, 10 Jun 2015 15:42:49 -0700 (PDT)\r
+From: Daniel Schoepe <daniel@schoepe.org>\r
+To: Christophe-Marie Duquesne <chmd@chmd.fr>,\r
+ David Bremner <david@tethera.net>\r
+Subject: Re: post-tag hook?\r
+In-Reply-To:\r
+ <CAHLp1YkWiYp0GedqP=neN7um_pQBZ3qqB9qG7cqVurL5oOddEg@mail.gmail.com>\r
+References:\r
+ <CAHLp1Y=2gSnmaGbVJvfAj=DvvGKq-Lm71h-jvNFfyGPzdXjfCA@mail.gmail.com>\r
+ <871tlepkfi.fsf@maritornes.cs.unb.ca>\r
+ <CAHLp1YkWiYp0GedqP=neN7um_pQBZ3qqB9qG7cqVurL5oOddEg@mail.gmail.com>\r
+User-Agent: Notmuch/0.19 (http://notmuchmail.org) Emacs/24.5.1\r
+ (x86_64-unknown-linux-gnu)\r
+Date: Thu, 11 Jun 2015 00:42:36 +0200\r
+Message-ID: <87r3pjyylf.fsf@schoepe.localhost>\r
+MIME-Version: 1.0\r
+Content-Type: text/plain\r
+Cc: notmuch@notmuchmail.org\r
+X-BeenThere: notmuch@notmuchmail.org\r
+X-Mailman-Version: 2.1.18\r
+Precedence: list\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: Wed, 10 Jun 2015 22:42:57 -0000\r
+\r
+Hi,\r
+\r
+for what it's worth, you can simulate a post-tag hook in a somewhat ugly\r
+way by putting a script called "notmuch" in front of the notmuch binary\r
+in your PATH. The script can then call the original notmuch binary as\r
+usual, inspect the first argument, and, if it's "tag", invoke your\r
+script afterwards. I.e. something like this:\r
+\r
+-------------------------------------\r
+#!/bin/sh\r
+\r
+/usr/bin/notmuch $@\r
+retval=$?\r
+if [[ "$1" == "tag" ]]; then\r
+   shift 1\r
+   your-script $@\r
+fi\r
+exit $retval\r
+-------------------------------------\r
+\r
+On a more general note, I'm experimenting with a way to synchronize tags\r
+by logging and replaying tag commands performed on other machines and\r
+for such an approach a post-tag hook would help. It seems to me that not\r
+all use cases for a post-tag hook can be handled as nicely with mtimes.\r
+\r
+Best regards,\r
+Daniel\r
+\r