Home
Reading
Searching
Subscribe
Sponsors
Statistics
Posting
Contact
Spam
Lists
Links
About
Hosting
Filtering
Features Download
Marketing
Archives
FAQ
Blog
 
Gmane
From: Jani Nikula <jani-aiFqomq+EK0dnm+yROfE0A <at> public.gmane.org>
Subject: [RFC 5/5] cli: print number of ignored non-mails encountered in notmuch new scan
Newsgroups: gmane.mail.notmuch.general
Date: Tuesday 3rd November 2015 19:49:33 UTC (about 1 year ago)
Also advise the user how to ignore them explicitly.
---
 notmuch-new.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/notmuch-new.c b/notmuch-new.c
index d06f9c906fc6..8d942507364a 100644
--- a/notmuch-new.c
+++ b/notmuch-new.c
@@ -54,6 +54,7 @@ typedef struct {
     int total_files;
     int processed_files;
     int added_messages, removed_messages, renamed_messages;
+    int ignored_non_mails;
     struct timeval tv_start;
 
     _filename_list_t *removed_files;
@@ -295,6 +296,7 @@ add_file (notmuch_database_t *notmuch, const char
*filename,
 	    notmuch_message_maildir_flags_to_tags (message);
 	break;
     case NOTMUCH_STATUS_FILE_NOT_EMAIL:
+	state->ignored_non_mails++;
 	fprintf (stderr, "Note: Ignoring non-mail file: %s\n", filename);
 	break;
     /* Fatal issues. Don't process anymore. */
@@ -938,6 +940,11 @@ print_results (const add_files_state_t *state)
 	printf (" Detected %d file %s.", state->renamed_messages,
 		state->renamed_messages == 1 ? "rename" : "renames");
 
+    if (state->ignored_non_mails)
+	printf (" Ignored %d non-mail %s. (Use 'notmuch config append new.ignore
 [...]' to ignore explicitly.)",
+		state->ignored_non_mails,
+		state->ignored_non_mails == 1 ? "file" : "files");
+
     printf ("\n");
 }
 
-- 
2.1.4

_______________________________________________
notmuch mailing list
[email protected]
https://notmuchmail.org/mailman/listinfo/notmuch
 
CD: 3ms