From: Mark Walters Date: Sun, 25 Nov 2012 16:11:12 +0000 (+0000) Subject: Re: [PATCH v2 00/20] insert command X-Git-Url: http://git.tremily.us/gitweb.cgi?a=commitdiff_plain;h=810d2c28ebb5ebc74b6a2cc2a1d30e5beedc4b57;p=notmuch-archives.git Re: [PATCH v2 00/20] insert command --- diff --git a/c0/a59d823392176d051c0f0ef77832cdfc8cde27 b/c0/a59d823392176d051c0f0ef77832cdfc8cde27 new file mode 100644 index 000000000..281435ad2 --- /dev/null +++ b/c0/a59d823392176d051c0f0ef77832cdfc8cde27 @@ -0,0 +1,165 @@ +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 06017431FAF + for ; Sun, 25 Nov 2012 08:11:18 -0800 (PST) +X-Virus-Scanned: Debian amavisd-new at olra.theworths.org +X-Spam-Flag: NO +X-Spam-Score: -1.098 +X-Spam-Level: +X-Spam-Status: No, score=-1.098 tagged_above=-999 required=5 + tests=[DKIM_ADSP_CUSTOM_MED=0.001, FREEMAIL_FROM=0.001, + NML_ADSP_CUSTOM_MED=1.2, RCVD_IN_DNSWL_MED=-2.3] 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 oj1+PPXRHLaT for ; + Sun, 25 Nov 2012 08:11:16 -0800 (PST) +Received: from mail2.qmul.ac.uk (mail2.qmul.ac.uk [138.37.6.6]) + (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) + (No client certificate requested) + by olra.theworths.org (Postfix) with ESMTPS id 05781431FAE + for ; Sun, 25 Nov 2012 08:11:16 -0800 (PST) +Received: from smtp.qmul.ac.uk ([138.37.6.40]) + by mail2.qmul.ac.uk with esmtp (Exim 4.71) + (envelope-from ) + id 1TcenV-0004q9-Sh; Sun, 25 Nov 2012 16:11:12 +0000 +Received: from 93-97-24-31.zone5.bethere.co.uk ([93.97.24.31] helo=localhost) + by smtp.qmul.ac.uk with esmtpsa (TLSv1:AES128-SHA:128) (Exim 4.69) + (envelope-from ) + id 1TcenV-0001TF-FJ; Sun, 25 Nov 2012 16:11:09 +0000 +From: Mark Walters +To: Peter Wang , notmuch@notmuchmail.org +Subject: Re: [PATCH v2 00/20] insert command +In-Reply-To: <1353806206-29133-1-git-send-email-novalazy@gmail.com> +References: <1353806206-29133-1-git-send-email-novalazy@gmail.com> +User-Agent: Notmuch/0.14+81~g9730584 (http://notmuchmail.org) Emacs/23.4.1 + (x86_64-pc-linux-gnu) +Date: Sun, 25 Nov 2012 16:11:12 +0000 +Message-ID: <87boelk6hr.fsf@qmul.ac.uk> +MIME-Version: 1.0 +Content-Type: text/plain; charset=us-ascii +X-Sender-Host-Address: 93.97.24.31 +X-QM-SPAM-Info: Sender has good ham record. :) +X-QM-Body-MD5: b9bba2258e409ee7c8124bc603f719e1 (of first 20000 bytes) +X-SpamAssassin-Score: -1.8 +X-SpamAssassin-SpamBar: - +X-SpamAssassin-Report: The QM spam filters have analysed this message to + determine if it is + spam. We require at least 5.0 points to mark a message as spam. + This message scored -1.8 points. + Summary of the scoring: + * -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at http://www.dnswl.org/, + * medium trust + * [138.37.6.40 listed in list.dnswl.org] + * 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail + provider * (markwalters1009[at]gmail.com) + * 0.5 AWL AWL: From: address is in the auto white-list +X-QM-Scan-Virus: ClamAV says the message is clean +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, 25 Nov 2012 16:11:18 -0000 + + +This is series is looking good. I have a few minor issues but no more. + +There are two parts I don't really know enough about to be certain +about: the fsyncing and the sigtrap bit. + +For fsync: I have some recollection that you have to fsync all subpaths +to the root to guarantee that it makes it to the disk. + +One in particular that may need more fsyncing is if you create a folder +A/B/C/D/E/ for the messages then I think you only fsync the message and +A/B/C/D/E/new. + +My other comments are all very minor and are made in individual replies. + +Best wishes + +Mark + + +On Sun, 25 Nov 2012, Peter Wang wrote: +> This series mainly addresses the issues raised by Mark: +> +> - check talloc failures +> - deadlock in maildir_open_tmp +> - stricter file modes (0600 and 0700) +> - shared tag operation parser with notmuch-tag.c +> - simplified mkdir_parents +> - trap SIGINT +> - fsync after writing and rename +> - added a couple of tests +> - man page wording +> - comments +> +> Due to new restriction on tags beginning with '-', an argument beginning with +> "--" is no longer ambiguous so I have removed the optional "--" separator +> between options and tag operations. +> +> Peter Wang (20): +> tag: factor out tag operation parsing +> tag: make tag operation parser public +> cli: add stub for insert command +> insert: open Maildir tmp file +> insert: copy stdin to Maildir tmp file +> insert: move file from Maildir tmp to new +> insert: add new message to database +> insert: support --folder option +> insert: prevent writes outside Maildir hierarchy +> insert: apply default tags to new message +> insert: parse command-line tag operations +> insert: apply command-line tag operations +> insert: add --create-folder option +> insert: fsync after writing tmp file +> insert: fsync new directory after rename +> insert: trap SIGINT and clean up +> insert: add copyright line from notmuch-deliver +> test: add tests for insert +> man: document 'insert' command +> man: reference notmuch-insert.1 +> +> Makefile.local | 1 + +> man/Makefile.local | 1 + +> man/man1/notmuch-config.1 | 4 +- +> man/man1/notmuch-count.1 | 4 +- +> man/man1/notmuch-dump.1 | 4 +- +> man/man1/notmuch-insert.1 | 60 +++++ +> man/man1/notmuch-new.1 | 4 +- +> man/man1/notmuch-reply.1 | 3 +- +> man/man1/notmuch-restore.1 | 3 +- +> man/man1/notmuch-search.1 | 3 +- +> man/man1/notmuch-show.1 | 3 +- +> man/man1/notmuch-tag.1 | 3 +- +> man/man1/notmuch.1 | 3 +- +> man/man5/notmuch-hooks.5 | 4 +- +> man/man7/notmuch-search-terms.7 | 3 +- +> notmuch-client.h | 12 + +> notmuch-insert.c | 493 ++++++++++++++++++++++++++++++++++++++++ +> notmuch-tag.c | 79 ++++--- +> notmuch.c | 3 + +> test/insert | 93 ++++++++ +> test/notmuch-test | 1 + +> 21 files changed, 733 insertions(+), 51 deletions(-) +> create mode 100644 man/man1/notmuch-insert.1 +> create mode 100644 notmuch-insert.c +> create mode 100755 test/insert +> +> -- +> 1.7.12.1 +> +> _______________________________________________ +> notmuch mailing list +> notmuch@notmuchmail.org +> http://notmuchmail.org/mailman/listinfo/notmuch