Return-Path: X-Original-To: notmuch@notmuchmail.org Delivered-To: notmuch@notmuchmail.org Received: from localhost (localhost [127.0.0.1]) by olra.theworths.org (Postfix) with ESMTP id 46FD6431FAF for ; Sun, 19 Feb 2012 12:50:32 -0800 (PST) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: -0.7 X-Spam-Level: X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5 tests=[RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled Received: from olra.theworths.org ([127.0.0.1]) by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id KGDM4qxstO9T for ; Sun, 19 Feb 2012 12:50:30 -0800 (PST) Received: from mail-ww0-f45.google.com (mail-ww0-f45.google.com [74.125.82.45]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (No client certificate requested) by olra.theworths.org (Postfix) with ESMTPS id 3F16E431FC0 for ; Sun, 19 Feb 2012 12:50:27 -0800 (PST) Received: by mail-ww0-f45.google.com with SMTP id dt12so4008173wgb.2 for ; Sun, 19 Feb 2012 12:50:26 -0800 (PST) Received-SPF: pass (google.com: domain of pieter@praet.org designates 10.180.81.66 as permitted sender) client-ip=10.180.81.66; Authentication-Results: mr.google.com; spf=pass (google.com: domain of pieter@praet.org designates 10.180.81.66 as permitted sender) smtp.mail=pieter@praet.org Received: from mr.google.com ([10.180.81.66]) by 10.180.81.66 with SMTP id y2mr11810002wix.20.1329684626885 (num_hops = 1); Sun, 19 Feb 2012 12:50:26 -0800 (PST) MIME-Version: 1.0 Received: by 10.180.81.66 with SMTP id y2mr9879504wix.20.1329684626818; Sun, 19 Feb 2012 12:50:26 -0800 (PST) Received: from localhost (104.218-242-81.adsl-dyn.isp.belgacom.be. [81.242.218.104]) by mx.google.com with ESMTPS id dr5sm29363555wib.0.2012.02.19.12.50.26 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 19 Feb 2012 12:50:26 -0800 (PST) From: Pieter Praet To: David Bremner , Tomi Ollila Subject: [PATCH 4/6] cli: notmuch new: optionally output debug information when ignoring files/directories Date: Sun, 19 Feb 2012 21:47:54 +0100 Message-Id: <1329684476-9596-5-git-send-email-pieter@praet.org> X-Mailer: git-send-email 1.7.8.1 In-Reply-To: <1329684476-9596-1-git-send-email-pieter@praet.org> References: <8739a93beq.fsf@zancas.localnet> <1329684476-9596-1-git-send-email-pieter@praet.org> X-Gm-Message-State: ALoCoQl0GFGvPtd35WLgBeMDxR/23Ufm8Px8WuIVs9sA8w3Xg7s59EvVrVPk4eVHVzs+YYjEoehN Cc: Notmuch Mail X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.13 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, 19 Feb 2012 20:50:32 -0000 When running 'notmuch new' with the '--debug' option, output debug information regarding explicitly ignored files and directories. --- notmuch-new.c | 15 ++++++++++++++- 1 files changed, 14 insertions(+), 1 deletions(-) diff --git a/notmuch-new.c b/notmuch-new.c index ca12003..6f34da1 100644 --- a/notmuch-new.c +++ b/notmuch-new.c @@ -347,6 +347,10 @@ add_files_recursive (notmuch_database_t *notmuch, strcmp (entry->d_name, ".notmuch") == 0 || _entry_in_ignore_list (entry->d_name, state)) { + if (_entry_in_ignore_list (entry->d_name, state) && state->debug) + printf ("(D) add_files_recursive, pass 1: explicitly ignoring %s/%s\n", + path, + entry->d_name); continue; } @@ -387,8 +391,13 @@ add_files_recursive (notmuch_database_t *notmuch, entry = fs_entries[i]; /* Ignore files & directories user has configured to be ignored */ - if (_entry_in_ignore_list (entry->d_name, state)) + if (_entry_in_ignore_list (entry->d_name, state)) { + if (state->debug) + printf ("(D) add_files_recursive, pass 2: explicitly ignoring %s/%s\n", + path, + entry->d_name); continue; + } /* Check if we've walked past any names in db_files or * db_subdirs. If so, these have been deleted. */ @@ -701,6 +710,10 @@ count_files (const char *path, int *count, add_files_state_t *state) strcmp (entry->d_name, ".notmuch") == 0 || _entry_in_ignore_list (entry->d_name, state)) { + if (_entry_in_ignore_list (entry->d_name, state) && state->debug) + printf ("(D) count_files: explicitly ignoring %s/%s\n", + path, + entry->d_name); continue; } -- 1.7.8.1