From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:306:f42::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id 0HjMCABfyGHThAAAgWs5BA (envelope-from ) for ; Sun, 26 Dec 2021 13:24:32 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id mAiRBQBfyGHtsQAAauVa8A (envelope-from ) for ; Sun, 26 Dec 2021 13:24:32 +0100 Received: from mail.notmuchmail.org (yantan.tethera.net [135.181.149.255]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id BFF1A35615 for ; Sun, 26 Dec 2021 13:24:31 +0100 (CET) Received: from yantan.tethera.net (localhost [127.0.0.1]) by mail.notmuchmail.org (Postfix) with ESMTP id 25EE25F727; Sun, 26 Dec 2021 12:24:28 +0000 (UTC) Received: from fethera.tethera.net (fethera.tethera.net [IPv6:2607:5300:60:c5::1]) by mail.notmuchmail.org (Postfix) with ESMTP id 673A85F71B for ; Sun, 26 Dec 2021 12:24:25 +0000 (UTC) Received: by fethera.tethera.net (Postfix, from userid 1001) id F15705FC42; Sun, 26 Dec 2021 07:24:24 -0500 (EST) Received: (nullmailer pid 1994003 invoked by uid 1000); Sun, 26 Dec 2021 12:24:24 -0000 From: David Bremner To: notmuch@notmuchmail.org Subject: [PATCH 2/2] cli/new: only ignore .notmuch at top level Date: Sun, 26 Dec 2021 08:24:10 -0400 Message-Id: <20211226122410.1993982-2-david@tethera.net> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20211226122410.1993982-1-david@tethera.net> References: <20211226122410.1993982-1-david@tethera.net> MIME-Version: 1.0 Message-ID-Hash: HGIFJGZQPNNOXQNNPNNTUS5LHDXBKA4D X-Message-ID-Hash: HGIFJGZQPNNOXQNNPNNTUS5LHDXBKA4D X-MailFrom: bremner@tethera.net X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-notmuch.notmuchmail.org-0; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.3 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Migadu-Flow: FLOW_IN X-Migadu-Country: DE ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1640521471; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-owner:list-unsubscribe:list-subscribe:list-post; bh=rBwzp9Wdev6YA9KnJq8r+q2RaW/GMuejXVGJUa8Chdg=; b=Ap55mcVvk/VYU+N58gqOluBVeF762kzlxZt0N9J9m1XjFu1CDtwJHapzZuteLlhRJs8gNr 1eD2XRKHYvVYYyiJHjklInq5HWRWvNnd4/bgo5Xp+460uzeDJflqprPS1vlkWYIfeSMVBZ fiP+XaETweb9Rulayv559IWbSTeUV9gqzoW+yaPgMiB3cTzl6k5GUr5TXsDTxNaXfuLDq6 HOkr9R5oxM3si7Nd7ukPjvwPRXFKvjseCFsSTv2aOMW9+vsNEwLsXAHDjU+V6IDCothdHB jSBTpuX5VXPbNUJb0rU1831+0nRidUyr/APsmVeUEIDM5GSycxlIh2qiX303KA== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1640521471; a=rsa-sha256; cv=none; b=d+dg8fyR+BvuZOisZIjrpkA7cISYLXR1uTS+1tNU9jFrEKzbhCiMzoeDdaTkRUopsJuO9+ VqGUslyGOdQQwg0/HlhiymYNnsi2PajLitHLLHvJBOXWZnSsjjY2+6sf4JmOy1waKKzG9x 9Mgbjta+qU7LzIseMrArpLRyHefwZeBaG1bpgO+kaKGGaXwOfKKKqPMRLKlTqyreFcYnYh zvpmsxPclflKLazztg6PmjyAOxIvacseySqRuFOWuAd/uH0Bq5DizdGiRyHqfUJbSi92dH IcvEMGdviarmvb0pt4LD4vMCJB6y/VJqczlyT56pXOcTt3rOpn7pOQjzWDsulA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of notmuch-bounces@notmuchmail.org designates 135.181.149.255 as permitted sender) smtp.mailfrom=notmuch-bounces@notmuchmail.org X-Migadu-Spam-Score: -1.24 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of notmuch-bounces@notmuchmail.org designates 135.181.149.255 as permitted sender) smtp.mailfrom=notmuch-bounces@notmuchmail.org X-Migadu-Queue-Id: BFF1A35615 X-Spam-Score: -1.24 X-Migadu-Scanner: scn1.migadu.com X-TUID: 9mBoX5uoZ9oq Since the bug was first reported in [1], notmuch has gained the ability to have the database located outside the mail root, hence this this change differs slightly from Jani's proposed solution [2] in not using notmuch_database_get_path, but rather the already retrieved mail_root. [1]: id:87mwhifu9a.fsf@trouble.defaultvalue.org [2]: id:87ios5v59p.fsf@nikula.org --- notmuch-new.c | 5 +++-- test/T050-new.sh | 1 - 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/notmuch-new.c b/notmuch-new.c index 5b8fa340..346e6469 100644 --- a/notmuch-new.c +++ b/notmuch-new.c @@ -601,11 +601,12 @@ add_files (notmuch_database_t *notmuch, continue; } - /* Ignore the .notmuch directory and any "tmp" directory + /* Ignore any top level .notmuch directory and any "tmp" directory * that appears within a maildir. */ if ((is_maildir && strcmp (entry->d_name, "tmp") == 0) || - strcmp (entry->d_name, ".notmuch") == 0) + (strcmp (entry->d_name, ".notmuch") == 0 + && (strcmp (path, state->mail_root)) == 0)) continue; next = talloc_asprintf (notmuch, "%s/%s", path, entry->d_name); diff --git a/test/T050-new.sh b/test/T050-new.sh index db13090b..6791f87c 100755 --- a/test/T050-new.sh +++ b/test/T050-new.sh @@ -352,7 +352,6 @@ test_expect_code 1 "NOTMUCH_NEW --debug 2>&1" notmuch config set new.tags $OLDCONFIG test_begin_subtest ".notmuch only ignored at top level" -test_subtest_known_broken generate_message '[dir]=foo/bar/.notmuch/cur' '[subject]="Do not ignore, very important"' NOTMUCH_NEW > OUTPUT notmuch search subject:Do-not-ignore | notmuch_search_sanitize >> OUTPUT -- 2.34.1