From: Jani Nikula Date: Mon, 13 May 2013 18:26:55 +0000 (+0300) Subject: [PATCH 0/6] cli: better tooling support for duplicate messages X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=1819992a79f95c2533d76f4e82512a2f14f29033;p=notmuch-archives.git [PATCH 0/6] cli: better tooling support for duplicate messages --- diff --git a/a5/e007f8198764b00296b451618cb123b4f51006 b/a5/e007f8198764b00296b451618cb123b4f51006 new file mode 100644 index 000000000..398046ea9 --- /dev/null +++ b/a5/e007f8198764b00296b451618cb123b4f51006 @@ -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 olra.theworths.org (Postfix) with ESMTP id 0C65F431FBD + for ; Mon, 13 May 2013 11:27:13 -0700 (PDT) +X-Virus-Scanned: Debian amavisd-new at olra.theworths.org +X-Spam-Flag: NO +X-Spam-Score: -0.7 +X-Spam-Level: +X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5 + tests=[RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled +Received: from olra.theworths.org ([127.0.0.1]) + by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) + with ESMTP id RsI5FwdqR6u1 for ; + Mon, 13 May 2013 11:27:07 -0700 (PDT) +Received: from mail-la0-f50.google.com (mail-la0-f50.google.com + [209.85.215.50]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) + (No client certificate requested) + by olra.theworths.org (Postfix) with ESMTPS id 549F1431FAE + for ; Mon, 13 May 2013 11:27:07 -0700 (PDT) +Received: by mail-la0-f50.google.com with SMTP id dz20so2602264lab.37 + for ; Mon, 13 May 2013 11:27:04 -0700 (PDT) +X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; + d=google.com; s=20120113; + h=x-received:from:to:subject:date:message-id:x-mailer + :x-gm-message-state; + bh=1/1Tv66P7zq+O5D4q+V6l1miYoOZWKV+nyOR633I/5E=; + b=INdigKLvXTQFnEvOWRIkOgBlvTE/cKiRy1T+L3KNt24e5m1ABc8hXe3AR0Ea8BXDml + L5kQhozdu28Kn7RpHdFrs/J1ZONdb+v4u/mAu/TLdmKKB8HqL4HBPlQFPhT/6BkUT1dF + 3CgV5dIfMAMI6fsi4/7XUYijrZRqLGPvKNM/D0jeubHDDxnOqeJzc+O0/RV6GVsjjaJH + QlYMX3WNkWs18Z6n34hRWoFuc6khNpCWc6wo1RXbzboEJkQOl7DAk18xZaCwganA7X6M + JZIrGBuUFBlKzhyEFtrCxTi2GW1R+yj6cDU18HPUy5uz5ed0WL6cJn024lxE2rAOsSqx + UOrQ== +X-Received: by 10.112.3.99 with SMTP id b3mr7873858lbb.52.1368469624406; + Mon, 13 May 2013 11:27:04 -0700 (PDT) +Received: from localhost (dsl-hkibrasgw2-58c376-211.dhcp.inet.fi. + [88.195.118.211]) + by mx.google.com with ESMTPSA id t4sm5922297lbe.7.2013.05.13.11.27.02 + for + (version=TLSv1.2 cipher=RC4-SHA bits=128/128); + Mon, 13 May 2013 11:27:03 -0700 (PDT) +From: Jani Nikula +To: notmuch@notmuchmail.org +Subject: [PATCH 0/6] cli: better tooling support for duplicate messages +Date: Mon, 13 May 2013 21:26:55 +0300 +Message-Id: +X-Mailer: git-send-email 1.7.10.4 +X-Gm-Message-State: + ALoCoQkFtKxySa/9WylXRJggYjGNFsVCPkpA05Nn2KU9hcVMH16v5K5KSf7H7xZGGaelorpmtAMR +X-BeenThere: notmuch@notmuchmail.org +X-Mailman-Version: 2.1.13 +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: Mon, 13 May 2013 18:27:13 -0000 + +Patches 1-3 are an answer to a question on IRC: + + is there a way for notmuch search --output=files to only output + one file for Message-ID instead of all? + +Yes, use --duplicate=0 on the command line. ;) + +I suggest this interface (instead of, say, --output=file1 which was also +contemplated) for two reasons: it allows one to choose also other files +than the first one, and the same interface could be used later on in +notmuch show to display the duplicates. + +An alternative could be something like --duplicates=(all|first|rest) +which would lack the possibility to pick a specific duplicate, but would +allow one to list all the "redundant" files with --duplicates=rest (this +would correspond to a number of invocations with --duplicate=1, +--duplicate=2, etc.) + +Patches 4-6 add support for querying the file counts in notmuch +count. Most useful with a single id: query I presume. + + +BR, +Jani. + + +Jani Nikula (6): + cli: add --duplicate=N option to notmuch search + test: test notmuch search --duplicate=N + man: document notmuch search --duplicate=N + cli: add --output=files option to notmuch count + test: test notmuch count --output=files + man: document notmuch count --output=files + + man/man1/notmuch-count.1 | 10 ++++++- + man/man1/notmuch-search.1 | 11 ++++++++ + notmuch-count.c | 37 ++++++++++++++++++++++++++ + notmuch-search.c | 18 ++++++++----- + test/count | 10 +++++++ + test/search-output | 65 +++++++++++++++++++++++++++++++++++++++++++++ + 6 files changed, 144 insertions(+), 7 deletions(-) + +-- +1.7.10.4 +