[PATCH 4/6] cli: notmuch new: optionally output debug information when ignoring files...
authorPieter Praet <pieter@praet.org>
Sun, 19 Feb 2012 20:47:54 +0000 (21:47 +0100)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:44:42 +0000 (09:44 -0800)
db/32967c5080f734d83d7b38db26189a06f81ab0 [new file with mode: 0644]

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