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 19984431FBC for ; Sat, 15 Dec 2012 11:21:21 -0800 (PST) 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=[none] 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 UD6rTYz6ZsNC for ; Sat, 15 Dec 2012 11:21:19 -0800 (PST) Received: from tesseract.cs.unb.ca (tesseract.cs.unb.ca [131.202.240.238]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by olra.theworths.org (Postfix) with ESMTPS id 129DA431FB6 for ; Sat, 15 Dec 2012 11:21:19 -0800 (PST) Received: from fctnnbsc30w-142167090129.dhcp-dynamic.fibreop.nb.bellaliant.net ([142.167.90.129] helo=zancas.localnet) by tesseract.cs.unb.ca with esmtpsa (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.72) (envelope-from ) id 1TjxIT-0006hM-MW; Sat, 15 Dec 2012 15:21:18 -0400 Received: from bremner by zancas.localnet with local (Exim 4.80) (envelope-from ) id 1TjxIO-0008D1-7F; Sat, 15 Dec 2012 15:21:12 -0400 From: david@tethera.net To: notmuch@notmuchmail.org Subject: [PATCH] fixup: clarify TAG_FLAG_ID_ONLY comments and name Date: Sat, 15 Dec 2012 15:21:09 -0400 Message-Id: <1355599269-31503-1-git-send-email-david@tethera.net> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <87wqwj8alx.fsf@qmul.ac.uk> References: <87wqwj8alx.fsf@qmul.ac.uk> X-Spam_bar: - Cc: David Bremner 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: Sat, 15 Dec 2012 19:21:21 -0000 From: David Bremner --- After some chatter on IRC, Mark and I converged to the following notmuch-restore.c | 2 +- tag-util.c | 2 +- tag-util.h | 6 ++++-- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/notmuch-restore.c b/notmuch-restore.c index 112f2f3..1b66e76 100644 --- a/notmuch-restore.c +++ b/notmuch-restore.c @@ -208,7 +208,7 @@ notmuch_restore_command (unused (void *ctx), int argc, char *argv[]) if (input_format == DUMP_FORMAT_SUP) { ret = parse_sup_line (ctx, line, &query_string, tag_ops); } else { - ret = parse_tag_line (ctx, line, TAG_FLAG_BE_GENEROUS | TAG_FLAG_ID_ONLY, + ret = parse_tag_line (ctx, line, TAG_FLAG_BE_GENEROUS | TAG_FLAG_ID_DIRECT, &query_string, tag_ops); } diff --git a/tag-util.c b/tag-util.c index 8fea76c..37bffd5 100644 --- a/tag-util.c +++ b/tag-util.c @@ -201,7 +201,7 @@ parse_tag_line (void *ctx, char *line, } /* tok now points to the query string */ - if (flags & TAG_FLAG_ID_ONLY) { + if (flags & TAG_FLAG_ID_DIRECT) { /* this is under the assumption that any whitespace in the * message-id must be hex-encoded. The check is probably not * perfect for exotic unicode whitespace; as fallback the diff --git a/tag-util.h b/tag-util.h index 7674051..eec00cf 100644 --- a/tag-util.h +++ b/tag-util.h @@ -28,8 +28,10 @@ typedef enum { */ TAG_FLAG_BE_GENEROUS = (1 << 3), - /* Query consists of a single id:$message-id */ - TAG_FLAG_ID_ONLY = (1 << 4) + /* Directly look up messages by hex-decoded message-id, rather + * than parsing a general query. The query MUST be of the form + * id:$message-id. */ + TAG_FLAG_ID_DIRECT = (1 << 4) } tag_op_flag_t; -- 1.7.10.4