--- /dev/null
+Return-Path: <tomi.ollila@iki.fi>\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 B38856DE1AD8\r
+ for <notmuch@notmuchmail.org>; Sun, 6 Sep 2015 03:02:10 -0700 (PDT)\r
+X-Virus-Scanned: Debian amavisd-new at cworth.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: 0.804\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=0.804 tagged_above=-999 required=5 tests=[AWL=0.152, \r
+ SPF_NEUTRAL=0.652] 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 R0OPeyntgZSa for <notmuch@notmuchmail.org>;\r
+ Sun, 6 Sep 2015 03:02:08 -0700 (PDT)\r
+Received: from guru.guru-group.fi (guru.guru-group.fi [46.183.73.34])\r
+ by arlo.cworth.org (Postfix) with ESMTP id 667CB6DE143A\r
+ for <notmuch@notmuchmail.org>; Sun, 6 Sep 2015 03:02:08 -0700 (PDT)\r
+Received: from guru.guru-group.fi (localhost [IPv6:::1])\r
+ by guru.guru-group.fi (Postfix) with ESMTP id 1718E100033;\r
+ Sun, 6 Sep 2015 13:00:42 +0300 (EEST)\r
+From: Tomi Ollila <tomi.ollila@iki.fi>\r
+To: Jani Nikula <jani@nikula.org>, Mark Walters <markwalters1009@gmail.com>,\r
+ notmuch@notmuchmail.org\r
+Subject: Re: [PATCH 2/2] cli: reset db directory mtime upon directory removal\r
+In-Reply-To: <1441445731-4362-2-git-send-email-jani@nikula.org>\r
+References: <87siray6th.fsf@qmul.ac.uk>\r
+ <1441445731-4362-1-git-send-email-jani@nikula.org>\r
+ <1441445731-4362-2-git-send-email-jani@nikula.org>\r
+User-Agent: Notmuch/0.20.2+68~g0c35549 (http://notmuchmail.org) Emacs/24.3.1\r
+ (x86_64-unknown-linux-gnu)\r
+X-Face: HhBM'cA~<r"^Xv\KRN0P{vn'Y"Kd;zg_y3S[4)KSN~s?O\"QPoL\r
+ $[Xv_BD:i/F$WiEWax}R(MPS`^UaptOGD`*/=@\1lKoVa9tnrg0TW?"r7aRtgk[F\r
+ !)g;OY^,BjTbr)Np:%c_o'jj,Z\r
+Date: Sun, 06 Sep 2015 13:00:42 +0300\r
+Message-ID: <m2egib27g5.fsf@guru.guru-group.fi>\r
+MIME-Version: 1.0\r
+Content-Type: text/plain\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, 06 Sep 2015 10:02:10 -0000\r
+\r
+On Sat, Sep 05 2015, Jani Nikula <jani@nikula.org> wrote:\r
+\r
+> The library does not have a function to remove a directory document\r
+> for a path. Usually this doesn't matter except for a slight waste of\r
+> space. However, if the same directory gets added to the filesystem\r
+> again, the old directory document is found with the old mtime. Reset\r
+> the directory mtime on removal to avoid problems.\r
+>\r
+> The corner case that can hit this problem is renaming directories back\r
+> and forth. Renaming does not change the mtime of the directory in the\r
+> filesystem, and thus the old db directory document mtime may match the\r
+> fs mtime of the directory.\r
+>\r
+> The long term fix might be to add a library function to remove a\r
+> directory document, however this is a much simpler and faster fix for\r
+> the time being.\r
+> ---\r
+\r
+LGTM.\r
+\r
+Tomi\r
+\r
+\r
+> notmuch-new.c | 9 +++++++++\r
+> 1 file changed, 9 insertions(+)\r
+>\r
+> diff --git a/notmuch-new.c b/notmuch-new.c\r
+> index 514e06a4d1f3..33645349cd5f 100644\r
+> --- a/notmuch-new.c\r
+> +++ b/notmuch-new.c\r
+> @@ -878,6 +878,15 @@ _remove_directory (void *ctx,\r
+> goto DONE;\r
+> }\r
+> \r
+> + /*\r
+> + * XXX: The library does not have a function to remove a directory\r
+> + * document for a path. Usually this doesn't matter except for a\r
+> + * slight waste of space. However, if the directory gets added to\r
+> + * the filesystem again, the old directory document is found with\r
+> + * the old mtime. Reset the directory mtime to avoid problems.\r
+> + */\r
+> + notmuch_directory_set_mtime (directory, 0);\r
+> +\r
+> DONE:\r
+> notmuch_directory_destroy (directory);\r
+> return status;\r
+> -- \r
+> 2.1.4\r
+>\r
+> _______________________________________________\r
+> notmuch mailing list\r
+> notmuch@notmuchmail.org\r
+> http://notmuchmail.org/mailman/listinfo/notmuch\r