From 02e8b9f1407b889f7c7d029e61473cb45abf0b03 Mon Sep 17 00:00:00 2001 From: Jani Nikula Date: Mon, 22 Sep 2014 11:54:20 +0200 Subject: [PATCH] [PATCH 00/11] notmuch insert updates --- 05/f6d441e0488e0a563fbdd2df606956453b0775 | 94 +++++++++++++++++++++++ 1 file changed, 94 insertions(+) create mode 100644 05/f6d441e0488e0a563fbdd2df606956453b0775 diff --git a/05/f6d441e0488e0a563fbdd2df606956453b0775 b/05/f6d441e0488e0a563fbdd2df606956453b0775 new file mode 100644 index 000000000..51301f577 --- /dev/null +++ b/05/f6d441e0488e0a563fbdd2df606956453b0775 @@ -0,0 +1,94 @@ +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 18E27431FBC + for ; Mon, 22 Sep 2014 02:54:16 -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 iJRQ4f0nIlGH for ; + Mon, 22 Sep 2014 02:54:08 -0700 (PDT) +Received: from mail-wg0-f47.google.com (mail-wg0-f47.google.com + [74.125.82.47]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (No client + certificate requested) by olra.theworths.org (Postfix) with ESMTPS id + 09DAB431FB6 for ; Mon, 22 Sep 2014 02:54:07 -0700 + (PDT) +Received: by mail-wg0-f47.google.com with SMTP id y10so2629823wgg.6 + for ; Mon, 22 Sep 2014 02:54:06 -0700 (PDT) +X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; + d=1e100.net; s=20130820; + h=x-gm-message-state:from:to:cc:subject:date:message-id; + bh=D5lQOGVFo/Jm32yeMbhYst8UHSzSk09aI6FbAAKe0VY=; + b=MQjNKvmszVC93liRi8qihtYMg1S8d1lMEzDvjMYzTvXYwIynMVCTj3tWQC9V9GkOAJ + MofVyJsVarOTgOp8FKoVXwpiw+/HFFLDvQIACgIGuOP7dKB8uNTV3Fd9ZQe/sGHwJs8s + w03gHUZoZ/08FpVZelcm41vcMZIV6alyJlxLSMODdg0BzO2ZGiuRPNAp9UmCxI39MTD2 + DlX+cerONZ5WE9OURrLyM9LFsgm3EQUOWBSPXTQCgCa6shkRYmbJe/oq0HVV/9OzBQME + vVF+Fo6syXVssYsRgiBCtgAhxL/IeW69KJyhGI6G0Dxxqc1a3kQKEGkCH61/oUEzl7Wp + +nww== +X-Gm-Message-State: + ALoCoQlqNNsKOLVpXSLyIBzM3ebIW8OfhTdJlCyy8zveVDinNTwglCWiONU6v8fhIXjUsApmRq0j +X-Received: by 10.180.206.230 with SMTP id lr6mr14434191wic.82.1411379646476; + Mon, 22 Sep 2014 02:54:06 -0700 (PDT) +Received: from localhost ([2001:4b98:dc0:43:216:3eff:fe1b:25f3]) + by mx.google.com with ESMTPSA id + om1sm11692648wjc.42.2014.09.22.02.54.05 for + (version=TLSv1.1 cipher=RC4-SHA bits=128/128); + Mon, 22 Sep 2014 02:54:05 -0700 (PDT) +From: Jani Nikula +To: notmuch@notmuchmail.org +Subject: [PATCH 00/11] notmuch insert updates +Date: Mon, 22 Sep 2014 11:54:20 +0200 +Message-Id: +X-Mailer: git-send-email 1.7.2.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: Mon, 22 Sep 2014 09:54:16 -0000 + +This series refactors and cleans up insert, improves error handling and +reporting, and adds post-insert hook. I intend to add documentation and +more tests, but the code is ready for review. Also, at least some of the +cleanups and fixes in the beginning of the series could go in without +additional tests or documentation. + +BR, +Jani. + + +Jani Nikula (11): + lib: actually return failures from + notmuch_message_tags_to_maildir_flags + cli/insert: rename check_folder_name to is_valid_folder_name + cli/insert: move add_file_to_database to a better place + cli/insert: rename file copy function + cli/insert: clean up sync_dir + cli/insert: use a single recursive mkdir function + cli/insert: abstract temporary filename generation + cli/insert: rehash file writing functions + cli/insert: add fail path to add_file_to_database + cli/insert: require succesful message indexing for success status + cli/insert: add post-insert hook + + lib/message.cc | 2 +- + notmuch-insert.c | 462 +++++++++++++++++++++++++++++---------------------- + test/T070-insert.sh | 2 +- + 3 files changed, 262 insertions(+), 204 deletions(-) + +-- +1.7.2.5 + -- 2.26.2