Re: [PATCH] contrib/nmbug: new script for sharing tags with prefix notmuch::
authorAli Polatel <polatel@gmail.com>
Sat, 29 Oct 2011 21:11:35 +0000 (00:11 +0300)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:39:51 +0000 (09:39 -0800)
6f/f76e782197820b6f8f95a91943edd7089b7b5c [new file with mode: 0644]

diff --git a/6f/f76e782197820b6f8f95a91943edd7089b7b5c b/6f/f76e782197820b6f8f95a91943edd7089b7b5c
new file mode 100644 (file)
index 0000000..7a3d3ac
--- /dev/null
@@ -0,0 +1,191 @@
+Return-Path: <polatel@gmail.com>\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 40932429E25\r
+       for <notmuch@notmuchmail.org>; Sat, 29 Oct 2011 14:11:50 -0700 (PDT)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: -0.799\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=-0.799 tagged_above=-999 required=5\r
+       tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1,\r
+       FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled\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 TAcStKm1vfnP for <notmuch@notmuchmail.org>;\r
+       Sat, 29 Oct 2011 14:11:48 -0700 (PDT)\r
+Received: from mail-fx0-f53.google.com (mail-fx0-f53.google.com\r
+       [209.85.161.53]) (using TLSv1 with cipher RC4-SHA (128/128 bits))\r
+       (No client certificate requested)\r
+       by olra.theworths.org (Postfix) with ESMTPS id BC206431FB6\r
+       for <notmuch@notmuchmail.org>; Sat, 29 Oct 2011 14:11:47 -0700 (PDT)\r
+Received: by faai28 with SMTP id i28so5123476faa.26\r
+       for <notmuch@notmuchmail.org>; Sat, 29 Oct 2011 14:11:46 -0700 (PDT)\r
+DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;\r
+       h=date:from:to:cc:subject:message-id:mail-followup-to:references\r
+       :mime-version:content-type:content-disposition:in-reply-to\r
+       :organization:user-agent;\r
+       bh=ocZb+P6BLIrUL+mVAnaXxLSBUCCN4fauBvlgrwcZ8Gk=;\r
+       b=WPAyF+kXOigU9W3ozqJ+a3rjoqFVm798veE0ypl2o+57OxvSTxLhM1jv1t0iaa/TNm\r
+       6kGWQZYwVq2wlJZsjI/BMe3rwifutxjd36oLO6T+uVL9WTBJ0OhFlLC1ERB596SD3hdu\r
+       yw/NPsVdCF3SgX0RISvpIcNOt83SXzXhXaoIo=\r
+Received: by 10.223.15.13 with SMTP id i13mr16257504faa.36.1319922700455;\r
+       Sat, 29 Oct 2011 14:11:40 -0700 (PDT)\r
+Received: from localhost ([88.236.24.25])\r
+       by mx.google.com with ESMTPS id k16sm26695430fab.8.2011.10.29.14.11.38\r
+       (version=TLSv1/SSLv3 cipher=OTHER);\r
+       Sat, 29 Oct 2011 14:11:39 -0700 (PDT)\r
+Date: Sun, 30 Oct 2011 00:11:35 +0300\r
+From: Ali Polatel <polatel@gmail.com>\r
+To: David Bremner <david@tethera.net>\r
+Subject: Re: [PATCH] contrib/nmbug: new script for sharing tags with prefix\r
+       notmuch::\r
+Message-ID: <20111029211134.GB4228@hayalet>\r
+Mail-Followup-To: David Bremner <david@tethera.net>,\r
+       notmuch@notmuchmail.org, David Bremner <bremner@debian.org>\r
+References: <1319857491-12298-5-git-send-email-david@tethera.net>\r
+       <1319906707-10141-1-git-send-email-david@tethera.net>\r
+       <1319906707-10141-2-git-send-email-david@tethera.net>\r
+MIME-Version: 1.0\r
+Content-Type: multipart/signed; micalg=pgp-sha1;\r
+       protocol="application/pgp-signature"; boundary="0eh6TmSyL6TZE2Uz"\r
+Content-Disposition: inline\r
+In-Reply-To: <1319906707-10141-2-git-send-email-david@tethera.net>\r
+Organization: Pink Floyd\r
+User-Agent: Mutt/1.5.21 (2010-09-15)\r
+Cc: notmuch@notmuchmail.org, David Bremner <bremner@debian.org>\r
+X-BeenThere: notmuch@notmuchmail.org\r
+X-Mailman-Version: 2.1.13\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: Sat, 29 Oct 2011 21:11:50 -0000\r
+\r
+\r
+--0eh6TmSyL6TZE2Uz\r
+Content-Type: text/plain; charset=us-ascii; format=flowed\r
+Content-Disposition: inline\r
+Content-Transfer-Encoding: quoted-printable\r
+\r
+On Sat, Oct 29, 2011 at 01:45:07PM -0300, David Bremner wrote:\r
+>From: David Bremner <bremner@debian.org>\r
+>\r
+>In this initial version, we take care of only the base import and\r
+>export of the appropriate tags in line oriented format amenable to\r
+>easy merging.\r
+>\r
+>The current plan to use git to share tags and resolve conflicts.\r
+>---\r
+> contrib/nmbug |   69 ++++++++++++++++++++++++++++++++++++++++++++++++++++=\r
++++++\r
+> 1 files changed, 69 insertions(+), 0 deletions(-)\r
+> create mode 100755 contrib/nmbug\r
+>\r
+>diff --git a/contrib/nmbug b/contrib/nmbug\r
+>new file mode 100755\r
+>index 0000000..e9d1b14\r
+>--- /dev/null\r
+>+++ b/contrib/nmbug\r
+>@@ -0,0 +1,69 @@\r
+>+#!/bin/bash\r
+\r
+^^ I'd make that:\r
+#!/usr/bin/env bash\r
+for systems where bash is not the default shell.\r
+\r
+>+# Copyright (c) 2011 David Bremner\r
+>+# License: same as notmuch\r
+>+\r
+>+NMHOME=3D${HOME}/.nmbug\r
+>+\r
+>+NMTAGS=3D($(notmuch search --output=3Dtags "*"|grep "^notmuch::"))\r
+>+\r
+>+function dump() {\r
+>+    notmuch dump -- $(printf  " tag:%s" ${NMTAGS[*]}) |\\r
+>+    while read  -r msgid rest\r
+>+    do\r
+>+     outfile=3D$NMHOME/tags/$(echo $msgid | sha1sum - | cut -f1 -d' ')\r
+>+     echo $outfile\r
+>+     printf "msg-id: %s\n" $msgid > $outfile\r
+>+     tmp=3D${rest#\(}\r
+>+     read -r -a tags <<<${tmp%\)};\r
+>+     for tag in "${tags[@]}"; do\r
+>+         case $tag in\r
+>+             notmuch::*)\r
+>+                 echo "tag: $tag" >> $outfile\r
+>+                 ;;\r
+>+             *)\r
+>+             # nothing\r
+>+         esac\r
+>+     done\r
+>+    done\r
+>+\r
+>+}\r
+>+\r
+>+function cat_file() {\r
+>+    tags=3D""\r
+>+    id=3D""\r
+>+    cat $1 |\\r
+>+    while read -r what data\r
+>+    do\r
+>+     case $what in\r
+>+         msg-id:)\r
+>+             printf "%s (" $data\r
+>+             ;;\r
+>+         tag:)\r
+>+             printf "%s " $data\r
+>+             ;;\r
+>+         *)\r
+>+             echo "Syntax error $what"\r
+>+             exit 1\r
+>+     esac\r
+>+    done\r
+>+    echo ")"\r
+>+}\r
+>+\r
+>+function restore() {\r
+>+    find $NMHOME/tags -type f |\\r
+>+    while read -r filename\r
+>+    do\r
+>+     cat_file $filename\r
+>+    done | notmuch restore --match=3Dnotmuch::\r
+>+}\r
+>+case $1 in\r
+>+    dump)\r
+>+     dump\r
+>+     ;;\r
+>+    restore)\r
+>+     restore\r
+>+     ;;\r
+>+    *)\r
+>+     echo unknown command $1;\r
+>+esac\r
+>+\r
+>--=20\r
+>1.7.6.3\r
+>\r
+>_______________________________________________\r
+>notmuch mailing list\r
+>notmuch@notmuchmail.org\r
+>http://notmuchmail.org/mailman/listinfo/notmuch\r
+\r
+--0eh6TmSyL6TZE2Uz\r
+Content-Type: application/pgp-signature\r
+\r
+-----BEGIN PGP SIGNATURE-----\r
+Version: GnuPG v2.0.18 (GNU/Linux)\r
+\r
+iEYEARECAAYFAk6sbAYACgkQQU4yORhF8iDaqQCePu8QY1DNdjLoV0hkWDLqHGha\r
+8LIAn0Oaj3rCct2LtwxBx9Jaf7ilfSq0\r
+=DgyJ\r
+-----END PGP SIGNATURE-----\r
+\r
+--0eh6TmSyL6TZE2Uz--\r