From: David Bremner Date: Mon, 28 Sep 2015 11:42:24 +0000 (+2100) Subject: Re: [PATCH 2/3] lib: add interface to delete directory documents X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=9d07bf31b9dd787247aac467a640b5a929774f3d;p=notmuch-archives.git Re: [PATCH 2/3] lib: add interface to delete directory documents --- diff --git a/4e/fe7d8cbc80c7a7feeb0064cc25565a0a72c3a1 b/4e/fe7d8cbc80c7a7feeb0064cc25565a0a72c3a1 new file mode 100644 index 000000000..55b3e24b3 --- /dev/null +++ b/4e/fe7d8cbc80c7a7feeb0064cc25565a0a72c3a1 @@ -0,0 +1,73 @@ +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 726736DE0298 + for ; Mon, 28 Sep 2015 04:44:33 -0700 (PDT) +X-Virus-Scanned: Debian amavisd-new at cworth.org +X-Spam-Flag: NO +X-Spam-Score: 0.106 +X-Spam-Level: +X-Spam-Status: No, score=0.106 tagged_above=-999 required=5 tests=[AWL=0.106] + 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 DfUSOkKbPCe6 for ; + Mon, 28 Sep 2015 04:44:31 -0700 (PDT) +Received: from gitolite.debian.net (gitolite.debian.net [87.98.215.224]) + by arlo.cworth.org (Postfix) with ESMTPS id 3410B6DE0274 + for ; Mon, 28 Sep 2015 04:44:31 -0700 (PDT) +Received: from remotemail by gitolite.debian.net with local (Exim 4.80) + (envelope-from ) + id 1ZgWpP-0003pU-BJ; Mon, 28 Sep 2015 11:42:43 +0000 +Received: (nullmailer pid 12592 invoked by uid 1000); Mon, 28 Sep 2015 + 11:42:24 -0000 +From: David Bremner +To: Jani Nikula , notmuch@notmuchmail.org +Subject: Re: [PATCH 2/3] lib: add interface to delete directory documents +In-Reply-To: + +References: + +User-Agent: Notmuch/0.20.2+93~g33c8777 (http://notmuchmail.org) Emacs/24.5.1 + (x86_64-pc-linux-gnu) +Date: Mon, 28 Sep 2015 08:42:24 -0300 +Message-ID: <871tdidb33.fsf@zancas.localnet> +MIME-Version: 1.0 +Content-Type: text/plain +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: Mon, 28 Sep 2015 11:44:33 -0000 + +Jani Nikula writes: + +> +> XXX: Should this also remove the files under it, or assume that's been +> done by the caller? Should this incorporate some or all of the +> functionality of _remove_directory() in notmuch-new.c? + +1) The top level _remove_directory function does seem to make sense in + the lib, however +2) it calls remove_filename, which reads and writes add_files_state in + pseudo-OO style. +3) In particular it needs to read synchronize_flags, and write + renamed_messages and removed_messages. + +I guess one solution would be to pass through three arguments. A fancier +version would be to pass in a "visitor" function and closure pointer. + +The cowardly solution would be to point at POSIX rmdir, and leave the +discussion immediately above for the future. + +d +