--- /dev/null
+Return-Path: <bremner@tesseract.cs.unb.ca>\r
+X-Original-To: notmuch@notmuchmail.org\r
+Delivered-To: notmuch@notmuchmail.org\r
+Received: from localhost (localhost [127.0.0.1])\r
+ by arlo.cworth.org (Postfix) with ESMTP id CDC246DE1789\r
+ for <notmuch@notmuchmail.org>; Sun, 2 Aug 2015 02:06:20 -0700 (PDT)\r
+X-Virus-Scanned: Debian amavisd-new at cworth.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: 0.151\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=0.151 tagged_above=-999 required=5 tests=[AWL=0.141, \r
+ T_HEADER_FROM_DIFFERENT_DOMAINS=0.01] autolearn=disabled\r
+Received: from arlo.cworth.org ([127.0.0.1])\r
+ by localhost (arlo.cworth.org [127.0.0.1]) (amavisd-new, port 10024)\r
+ with ESMTP id lkw_mofWh0xG for <notmuch@notmuchmail.org>;\r
+ Sun, 2 Aug 2015 02:06:18 -0700 (PDT)\r
+Received: from gitolite.debian.net (gitolite.debian.net [87.98.215.224])\r
+ by arlo.cworth.org (Postfix) with ESMTPS id 277BE6DE1785\r
+ for <notmuch@notmuchmail.org>; Sun, 2 Aug 2015 02:06:17 -0700 (PDT)\r
+Received: from remotemail by gitolite.debian.net with local (Exim 4.80)\r
+ (envelope-from <bremner@tesseract.cs.unb.ca>)\r
+ id 1ZLpD5-0000a2-CY; Sun, 02 Aug 2015 09:05:35 +0000\r
+Received: (nullmailer pid 19069 invoked by uid 1000); Sun, 02 Aug 2015\r
+ 09:05:18 -0000\r
+From: David Bremner <david@tethera.net>\r
+To: David Bremner <david@tethera.net>\r
+Subject: [PATCH v2] cli/new: add more debugging output\r
+Date: Sun, 2 Aug 2015 11:04:38 +0200\r
+Message-Id: <1438506278-18880-1-git-send-email-david@tethera.net>\r
+X-Mailer: git-send-email 2.1.4\r
+In-Reply-To: <87k2wybgjk.fsf@maritornes.cs.unb.ca>\r
+References: <87k2wybgjk.fsf@maritornes.cs.unb.ca>\r
+Cc: notmuch@notmuchmail.org\r
+X-BeenThere: notmuch@notmuchmail.org\r
+X-Mailman-Version: 2.1.18\r
+Precedence: list\r
+List-Id: "Use and development of the notmuch mail system."\r
+ <notmuch.notmuchmail.org>\r
+List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
+ <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
+List-Archive: <http://notmuchmail.org/pipermail/notmuch/>\r
+List-Post: <mailto:notmuch@notmuchmail.org>\r
+List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
+List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
+ <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
+X-List-Received-Date: Sun, 02 Aug 2015 09:06:20 -0000\r
+\r
+Try to narrow down what part of the code adds files and directories to\r
+the queue(s) to be deleted.\r
+---\r
+\r
+ - print slightly less scary messages\r
+ - use git-send-email to send\r
+\r
+ notmuch-new.c | 14 ++++++++++++++\r
+ 1 file changed, 14 insertions(+)\r
+\r
+diff --git a/notmuch-new.c b/notmuch-new.c\r
+index 8ff1ade..ee786a3 100644\r
+--- a/notmuch-new.c\r
++++ b/notmuch-new.c\r
+@@ -528,6 +528,10 @@ add_files (notmuch_database_t *notmuch,\r
+ "%s/%s", path,\r
+ notmuch_filenames_get (db_files));\r
+ \r
++ if (state->debug)\r
++ printf ("(D) add_files_recursive, pass 2: queuing passed file %s for deletion from database\n",\r
++ absolute);\r
++\r
+ _filename_list_add (state->removed_files, absolute);\r
+ \r
+ notmuch_filenames_move_to_next (db_files);\r
+@@ -542,6 +546,9 @@ add_files (notmuch_database_t *notmuch,\r
+ {\r
+ char *absolute = talloc_asprintf (state->removed_directories,\r
+ "%s/%s", path, filename);\r
++ if (state->debug)\r
++ printf ("(D) add_files_recursive, pass 2: queuing passed directory %s for deletion from database\n",\r
++ absolute);\r
+ \r
+ _filename_list_add (state->removed_directories, absolute);\r
+ }\r
+@@ -610,6 +617,9 @@ add_files (notmuch_database_t *notmuch,\r
+ char *absolute = talloc_asprintf (state->removed_files,\r
+ "%s/%s", path,\r
+ notmuch_filenames_get (db_files));\r
++ if (state->debug)\r
++ printf ("(D) add_files_recursive, pass 3: queuing leftover file %s for deletion from database\n",\r
++ absolute);\r
+ \r
+ _filename_list_add (state->removed_files, absolute);\r
+ \r
+@@ -622,6 +632,10 @@ add_files (notmuch_database_t *notmuch,\r
+ "%s/%s", path,\r
+ notmuch_filenames_get (db_subdirs));\r
+ \r
++ if (state->debug)\r
++ printf ("(D) add_files_recursive, pass 3: queuing leftover directory %s for deletion from database\n",\r
++ absolute);\r
++\r
+ _filename_list_add (state->removed_directories, absolute);\r
+ \r
+ notmuch_filenames_move_to_next (db_subdirs);\r
+-- \r
+2.1.4\r
+\r