From 7bce4989a01a879710484fffa936abfa1206cbbb Mon Sep 17 00:00:00 2001 From: Jani Nikula Date: Tue, 3 Nov 2015 21:49:30 +0200 Subject: [PATCH] [RFC 2/5] cli: don't call _entry_in_ignore_list twice in count files debug --- ef/4dec14763bf7ecbe2522106f253a5902178d35 | 123 ++++++++++++++++++++++ 1 file changed, 123 insertions(+) create mode 100644 ef/4dec14763bf7ecbe2522106f253a5902178d35 diff --git a/ef/4dec14763bf7ecbe2522106f253a5902178d35 b/ef/4dec14763bf7ecbe2522106f253a5902178d35 new file mode 100644 index 000000000..2bdc0439c --- /dev/null +++ b/ef/4dec14763bf7ecbe2522106f253a5902178d35 @@ -0,0 +1,123 @@ +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 ED64D6DE1926 + for ; Tue, 3 Nov 2015 11:50:16 -0800 (PST) +X-Virus-Scanned: Debian amavisd-new at cworth.org +X-Amavis-Alert: BAD HEADER SECTION, Duplicate header field: "References" +X-Spam-Flag: NO +X-Spam-Score: -0.191 +X-Spam-Level: +X-Spam-Status: No, score=-0.191 tagged_above=-999 required=5 + tests=[AWL=-0.171, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, + RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01] 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 oTgX5XodP2nv for ; + Tue, 3 Nov 2015 11:50:15 -0800 (PST) +Received: from mail-wm0-f49.google.com (mail-wm0-f49.google.com + [74.125.82.49]) by arlo.cworth.org (Postfix) with ESMTPS id 937236DE13DA for + ; Tue, 3 Nov 2015 11:50:14 -0800 (PST) +Received: by wmff134 with SMTP id f134so24165176wmf.0 + for ; Tue, 03 Nov 2015 11:50:13 -0800 (PST) +DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; + d=nikula_org.20150623.gappssmtp.com; s=20150623; + h=from:to:cc:subject:date:message-id:in-reply-to:references + :in-reply-to:references; + bh=xFYcTFBZC8NJtdDzfVhLqc8ITJopbseQm+4nWE0JbDg=; + b=q3XogTPh/PxKYlobQRBchPE+3fqc10qPD0d0TGTb+7DDNeckcDBGsj/6xYdCN9pb0e + kmZoX/SWmzsfRd1r7YA0O70gX4tyC9C5p6SraCjKFmDJwiz/kfRZSaoyHe8BR7JnGm3o + 9H9te/5GTKwCuRE/Q7ZEnNxC+h2fjCRZWvBykhZ6AtjPGKYMzkO1l1Y/M4+ekSg2Tfo5 + PQfqh60u394G+8UiCgOYxYhyzs3Fp8jvwGGNl3Xm+4I0tzrNKD/xyJWeMx2zAyrqjjvm + CDLcO7f30EH9vnzsAE16Z6pJ5o8nZCH0XilWZm4zt0/ovZY2w/R3675pT9KCCcdYxXiA + zQOA== +X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; + d=1e100.net; s=20130820; + h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to + :references:in-reply-to:references; + bh=xFYcTFBZC8NJtdDzfVhLqc8ITJopbseQm+4nWE0JbDg=; + b=XubV7cMzyAll/pNGjCyakq9ezrdIR8iiX5ZeiA+HgvwzSQxEDO29VHl6EUPVi1f9Tb + 02SVRnPgLHJMmK4YCAzjtUTZtX9iyrWjnw3eDwT75nyApi/CF2FDYPe7ZDuvWniXoROr + CutmWtdLO/b2+USNjSXLYH2Z/iU0EhRGpYBAbn/3PmRJfxhxxF4+HX3qvh0HODwa7zhC + 5OKGGGime0/1CycLESH5L29P9VqTBGKHgOG2TcRPQJfV+DrJvqIqRHvM8i1ZkdQWsX3O + U/o7K1hf4Nqet+/Bf03PV8it+UW70/5vObzv/PhhaD7wBxNI89YGZL4kJ74iF/TTl20D + 6bVg== +X-Gm-Message-State: + ALoCoQk0OyEIyFFYXna/Qw1eky351cv8pbdb8tmESRqE1xZHeEheHOeLP2wgn1Aw/o/n2AAjE6v/ +X-Received: by 10.28.143.21 with SMTP id r21mr20506910wmd.39.1446580213184; + Tue, 03 Nov 2015 11:50:13 -0800 (PST) +Received: from localhost (mobile-access-bceec0-208.dhcp.inet.fi. + [188.238.192.208]) + by smtp.gmail.com with ESMTPSA id n17sm24942049wmg.17.2015.11.03.11.50.12 + (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); + Tue, 03 Nov 2015 11:50:12 -0800 (PST) +From: Jani Nikula +To: notmuch@notmuchmail.org +Subject: [RFC 2/5] cli: don't call _entry_in_ignore_list twice in count files + debug +Date: Tue, 3 Nov 2015 21:49:30 +0200 +Message-Id: + +X-Mailer: git-send-email 2.1.4 +In-Reply-To: +References: +In-Reply-To: +References: +X-BeenThere: notmuch@notmuchmail.org +X-Mailman-Version: 2.1.20 +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: Tue, 03 Nov 2015 19:50:17 -0000 + +Split file ignores in count_files to fixed and user configured in +order to not have to call _entry_in_ignore_list twice when debugging +is enabled. Minor detail. +--- + notmuch-new.c | 18 ++++++++++-------- + 1 file changed, 10 insertions(+), 8 deletions(-) + +diff --git a/notmuch-new.c b/notmuch-new.c +index e5037761c8ee..da1d1be2ed3b 100644 +--- a/notmuch-new.c ++++ b/notmuch-new.c +@@ -734,18 +734,20 @@ count_files (const char *path, int *count, add_files_state_t *state) + entry = fs_entries[i]; + + /* Ignore special directories to avoid infinite recursion. +- * Also ignore the .notmuch directory and files/directories +- * the user has configured to be ignored. ++ * Also ignore the .notmuch directory. + */ + if (strcmp (entry->d_name, ".") == 0 || + strcmp (entry->d_name, "..") == 0 || +- strcmp (entry->d_name, ".notmuch") == 0 || +- _entry_in_ignore_list (entry->d_name, state)) +- { +- if (state->debug && _entry_in_ignore_list (entry->d_name, state)) ++ strcmp (entry->d_name, ".notmuch") == 0) ++ continue; ++ ++ /* Ignore any files/directories the user has configured to be ++ * ignored ++ */ ++ if (_entry_in_ignore_list (entry->d_name, state)) { ++ if (state->debug) + printf ("(D) count_files: explicitly ignoring %s/%s\n", +- path, +- entry->d_name); ++ path, entry->d_name); + continue; + } + +-- +2.1.4 + -- 2.26.2