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