From: Adam Wolfe Gordon Date: Sun, 14 Jul 2013 00:45:43 +0000 (+1800) Subject: [PATCH 0/3] Introduce the add command X-Git-Url: http://git.tremily.us/gitweb.cgi?a=commitdiff_plain;h=ace5bd5702c5a05b50b1342e4641a675f62d8e35;p=notmuch-archives.git [PATCH 0/3] Introduce the add command --- diff --git a/ca/1dd3a29f0684bfcdec3ad303709f8856511ed0 b/ca/1dd3a29f0684bfcdec3ad303709f8856511ed0 new file mode 100644 index 000000000..c3f32d3f4 --- /dev/null +++ b/ca/1dd3a29f0684bfcdec3ad303709f8856511ed0 @@ -0,0 +1,79 @@ +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 8E1FE431FCB + for ; Sat, 13 Jul 2013 17:55:32 -0700 (PDT) +X-Virus-Scanned: Debian amavisd-new at olra.theworths.org +X-Spam-Flag: NO +X-Spam-Score: 0 +X-Spam-Level: +X-Spam-Status: No, score=0 tagged_above=-999 required=5 + tests=[RCVD_IN_DNSWL_NONE=-0.0001] 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 JF36e9XmlJE1 for ; + Sat, 13 Jul 2013 17:55:25 -0700 (PDT) +Received: from smtp-out-01.shaw.ca (smtp-out-01.shaw.ca [64.59.136.137]) + by olra.theworths.org (Postfix) with ESMTP id F131B431FBF + for ; Sat, 13 Jul 2013 17:55:24 -0700 (PDT) +X-Cloudmark-SP-Filtered: true +X-Cloudmark-SP-Result: v=1.1 cv=GLqYwptGXHjY6tPk5kWRtHXJM/YfZPTWiIs1znw4zms= + c=1 sm=1 + a=A16mN0G_02cA:10 a=BLceEmwcHowA:10 a=gumk1giGF0obp6xRQyl7Yg==:17 + a=sDWRSQzO3c7R0vj9Q-8A:9 a=HpAAvcLHHh0Zw7uRqdWCyQ==:117 +Received: from unknown (HELO lagos.xvx.ca) ([68.150.39.45]) + by smtp-out-01.shaw.ca with ESMTP; 13 Jul 2013 18:45:54 -0600 +Received: by lagos.xvx.ca (Postfix, from userid 1000) + id 0EF058009323; Sat, 13 Jul 2013 18:45:54 -0600 (MDT) +From: Adam Wolfe Gordon +To: notmuch@notmuchmail.org +Subject: [PATCH 0/3] Introduce the add command +Date: Sat, 13 Jul 2013 18:45:43 -0600 +Message-Id: <1373762746-22308-1-git-send-email-awg+notmuch@xvx.ca> +X-Mailer: git-send-email 1.7.9.5 +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: Sun, 14 Jul 2013 00:55:32 -0000 + +Hi everyone, + +The recent introduction of insert inspired me to finally add a feature I've +been wanting: a command to index a specific file in the maildir. My usecase +for this is that I have an inotify-based script that watches for new mail +and calls notmuch new when new mail shows up. Running notmuch new in this +situation is overkill, since I know exactly what's changed. A faster command +that just adds a single file reduces contention on the database lock. + +This series introduces a new command, "notmuch add", which indexes a file +that already exists in the maildir. It is implemented in notmuch-insert.c +because it uses the basic infrastructure introduced for the insert command. + +Missing man page for now - wanted to get the code out first for review. + +-- Adam + +Adam Wolfe Gordon (3): + cli: Return an error code from add_message_to_database + cli: Introduce the add command + test: Add simple tests for the add command + + notmuch-client.h | 3 +++ + notmuch-insert.c | 57 +++++++++++++++++++++++++++++++++++++++++++++++++++--- + notmuch.c | 2 ++ + test/insert | 35 +++++++++++++++++++++++++++++++++ + 4 files changed, 94 insertions(+), 3 deletions(-) + +-- +1.7.9.5 +