From: David Bremner Date: Sun, 26 Apr 2015 23:45:03 +0000 (+0900) Subject: Re: Notmuch removing messages from the index, when calling `new` two times in a row X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=23c080dc53397f5a868f0af9a9f6cbcb80b4be2b;p=notmuch-archives.git Re: Notmuch removing messages from the index, when calling `new` two times in a row --- diff --git a/d0/dddcbd83dfeb6ecbcf23e9e7ffd426ae65c0df b/d0/dddcbd83dfeb6ecbcf23e9e7ffd426ae65c0df new file mode 100644 index 000000000..16979a258 --- /dev/null +++ b/d0/dddcbd83dfeb6ecbcf23e9e7ffd426ae65c0df @@ -0,0 +1,141 @@ +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 4EB2F6DE093A + for ; Sun, 26 Apr 2015 16:46:07 -0700 (PDT) +X-Virus-Scanned: Debian amavisd-new at cworth.org +X-Spam-Flag: NO +X-Spam-Score: 0.332 +X-Spam-Level: +X-Spam-Status: No, score=0.332 tagged_above=-999 required=5 tests=[AWL=0.332] + 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 ygA5r-bSThvQ for ; + Sun, 26 Apr 2015 16:46:05 -0700 (PDT) +Received: from mx.xen14.node3324.gplhost.com (gitolite.debian.net + [87.98.215.224]) + by arlo.cworth.org (Postfix) with ESMTPS id BA9146DE02D6 + for ; Sun, 26 Apr 2015 16:46:04 -0700 (PDT) +Received: from remotemail by mx.xen14.node3324.gplhost.com with local (Exim + 4.80) (envelope-from ) + id 1YmWEe-0002bb-E5; Sun, 26 Apr 2015 23:45:16 +0000 +Received: (nullmailer pid 21469 invoked by uid 1000); Sun, 26 Apr 2015 + 23:45:03 -0000 +From: David Bremner +To: Mayeu +Subject: Re: Notmuch removing messages from the index, when calling `new` two + times in a row +In-Reply-To: <20150424112914.5ffef31c@azathoth> +References: <87y4llpiom.fsf@azathoth.devlab.ch> + <87mw1z8pxu.fsf@maritornes.cs.unb.ca> + <87fv7ruk2j.fsf@azathoth.i-did-not-set--mail-host-address--so-tickle-me> + <87oame7a93.fsf@maritornes.cs.unb.ca> <20150424112914.5ffef31c@azathoth> +User-Agent: Notmuch/0.19+96~g703c8f9 (http://notmuchmail.org) Emacs/24.4.1 + (x86_64-pc-linux-gnu) +Date: Mon, 27 Apr 2015 08:45:03 +0900 +Message-ID: <87k2wybgjk.fsf@maritornes.cs.unb.ca> +MIME-Version: 1.0 +Content-Type: multipart/mixed; boundary="=-=-=" +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: Sun, 26 Apr 2015 23:46:07 -0000 + +--=-=-= +Content-Type: text/plain + +Mayeu writes: + +> On Fri, 24 Apr 2015 07:25:28 +0900 +> David Bremner wrote: +>> OK. Please try running "notmuch new" (the second time) with --debug. +> +> The output is exactly the same, no other information. I also tried to +> add --verbose but same output. Both are accepted as valid since I do +> net get back any error, but the output is not changed. +> + +I think there is just not enough debugging output in this part of the +code. If you can compile from source, please try the attached patch +(it's against master, but I guess it should apply to 0.19 as well). + + +--=-=-= +Content-Type: text/x-diff +Content-Disposition: inline; + filename=0001-cli-new-add-more-debugging-output.patch + +>From 52975ecfdc754863e9ac9b465257a566845377c3 Mon Sep 17 00:00:00 2001 +From: David Bremner +Date: Mon, 27 Apr 2015 08:42:36 +0900 +Subject: [PATCH] cli/new: add more debugging output + +Try to narrow down what part of the code adds files and directories to +the queue(s) to be deleted. +--- + notmuch-new.c | 14 ++++++++++++++ + 1 file changed, 14 insertions(+) + +diff --git a/notmuch-new.c b/notmuch-new.c +index e6c283e..39b0b9a 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\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\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\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\n", ++ absolute); ++ + _filename_list_add (state->removed_directories, absolute); + + notmuch_filenames_move_to_next (db_subdirs); +-- +2.1.4 + + +--=-=-=--