From: David Bremner Date: Tue, 4 Aug 2015 06:48:33 +0000 (+0200) Subject: [PATCH 2/3] cli/new: add more debugging output X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=ba894df95dca4162dceae32ab0d05c5337fe3739;p=notmuch-archives.git [PATCH 2/3] cli/new: add more debugging output --- diff --git a/73/6b6593f20f98171bce2e057efbdc79839b376a b/73/6b6593f20f98171bce2e057efbdc79839b376a new file mode 100644 index 000000000..2bd82874f --- /dev/null +++ b/73/6b6593f20f98171bce2e057efbdc79839b376a @@ -0,0 +1,119 @@ +Return-Path: +X-Original-To: notmuch@notmuchmail.org +Delivered-To: notmuch@notmuchmail.org +Received: from localhost (localhost [127.0.0.1]) + by arlo.cworth.org (Postfix) with ESMTP id 350C26DE0FF1 + for ; Mon, 3 Aug 2015 23:50:59 -0700 (PDT) +X-Virus-Scanned: Debian amavisd-new at cworth.org +X-Spam-Flag: NO +X-Spam-Score: 0.146 +X-Spam-Level: +X-Spam-Status: No, score=0.146 tagged_above=-999 required=5 tests=[AWL=0.136, + T_HEADER_FROM_DIFFERENT_DOMAINS=0.01] autolearn=disabled +Received: from arlo.cworth.org ([127.0.0.1]) + by localhost (arlo.cworth.org [127.0.0.1]) (amavisd-new, port 10024) + with ESMTP id bV9WZMaD5piQ for ; + Mon, 3 Aug 2015 23:50:57 -0700 (PDT) +Received: from gitolite.debian.net (gitolite.debian.net [87.98.215.224]) + by arlo.cworth.org (Postfix) with ESMTPS id 828E06DE1557 + for ; Mon, 3 Aug 2015 23:50:57 -0700 (PDT) +Received: from remotemail by gitolite.debian.net with local (Exim 4.80) + (envelope-from ) + id 1ZMW2l-0000Qc-Pd; Tue, 04 Aug 2015 06:49:47 +0000 +Received: (nullmailer pid 17855 invoked by uid 1000); Tue, 04 Aug 2015 + 06:48:55 -0000 +From: David Bremner +To: Tomi Ollila , David Bremner +Subject: [PATCH 2/3] cli/new: add more debugging output +Date: Tue, 4 Aug 2015 08:48:33 +0200 +Message-Id: <1438670914-17203-3-git-send-email-david@tethera.net> +X-Mailer: git-send-email 2.1.4 +In-Reply-To: <1438670914-17203-1-git-send-email-david@tethera.net> +References: + <1438670914-17203-1-git-send-email-david@tethera.net> +Cc: notmuch@notmuchmail.org +X-BeenThere: notmuch@notmuchmail.org +X-Mailman-Version: 2.1.18 +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: Tue, 04 Aug 2015 06:50:59 -0000 + +Try to narrow down what part of the code adds files and directories to +the queue(s) to be deleted. + +Update one test. The output is slightly confusing, but I believe it is +correct, resulting from a directory being discovered but containing only ignored files. +--- + notmuch-new.c | 14 ++++++++++++++ + test/T050-new.sh | 1 + + 2 files changed, 15 insertions(+) + +diff --git a/notmuch-new.c b/notmuch-new.c +index 8ff1ade..ee786a3 100644 +--- a/notmuch-new.c ++++ b/notmuch-new.c +@@ -528,6 +528,10 @@ add_files (notmuch_database_t *notmuch, + "%s/%s", path, + notmuch_filenames_get (db_files)); + ++ if (state->debug) ++ printf ("(D) add_files_recursive, pass 2: queuing passed file %s for deletion from database\n", ++ absolute); ++ + _filename_list_add (state->removed_files, absolute); + + notmuch_filenames_move_to_next (db_files); +@@ -542,6 +546,9 @@ add_files (notmuch_database_t *notmuch, + { + char *absolute = talloc_asprintf (state->removed_directories, + "%s/%s", path, filename); ++ if (state->debug) ++ printf ("(D) add_files_recursive, pass 2: queuing passed directory %s for deletion from database\n", ++ absolute); + + _filename_list_add (state->removed_directories, absolute); + } +@@ -610,6 +617,9 @@ add_files (notmuch_database_t *notmuch, + char *absolute = talloc_asprintf (state->removed_files, + "%s/%s", path, + notmuch_filenames_get (db_files)); ++ if (state->debug) ++ printf ("(D) add_files_recursive, pass 3: queuing leftover file %s for deletion from database\n", ++ absolute); + + _filename_list_add (state->removed_files, absolute); + +@@ -622,6 +632,10 @@ add_files (notmuch_database_t *notmuch, + "%s/%s", path, + notmuch_filenames_get (db_subdirs)); + ++ if (state->debug) ++ printf ("(D) add_files_recursive, pass 3: queuing leftover directory %s for deletion from database\n", ++ absolute); ++ + _filename_list_add (state->removed_directories, absolute); + + notmuch_filenames_move_to_next (db_subdirs); +diff --git a/test/T050-new.sh b/test/T050-new.sh +index 66ea10f..ab15ca1 100755 +--- a/test/T050-new.sh ++++ b/test/T050-new.sh +@@ -238,6 +238,7 @@ test_expect_equal "$output" \ + (D) add_files_recursive, pass 2: explicitly ignoring ${MAIL_DIR}/one/two/ignored_file + (D) add_files_recursive, pass 2: explicitly ignoring ${MAIL_DIR}/one/two/three/.git + (D) add_files_recursive, pass 2: explicitly ignoring ${MAIL_DIR}/one/two/three/ignored_file ++(D) add_files_recursive, pass 3: queuing leftover directory ${MAIL_DIR}/two for deletion from database + No new mail." + + +-- +2.1.4 +