unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
* [PATCH] cli: don't call _entry_in_ignore_list twice in count files debug
@ 2016-12-17 16:28 Jani Nikula
  2017-01-25 20:18 ` Tomi Ollila
  2017-01-28  2:31 ` David Bremner
  0 siblings, 2 replies; 3+ messages in thread
From: Jani Nikula @ 2016-12-17 16:28 UTC (permalink / raw)
  To: notmuch

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 cc680b412a45..13212639cc8e 100644
--- a/notmuch-new.c
+++ b/notmuch-new.c
@@ -738,18 +738,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.10.2

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] cli: don't call _entry_in_ignore_list twice in count files debug
  2016-12-17 16:28 [PATCH] cli: don't call _entry_in_ignore_list twice in count files debug Jani Nikula
@ 2017-01-25 20:18 ` Tomi Ollila
  2017-01-28  2:31 ` David Bremner
  1 sibling, 0 replies; 3+ messages in thread
From: Tomi Ollila @ 2017-01-25 20:18 UTC (permalink / raw)
  To: notmuch

On Sat, Dec 17 2016, Jani Nikula <jani@nikula.org> wrote:

> 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.
> ---

LGTM.

Tomi


>  notmuch-new.c | 18 ++++++++++--------
>  1 file changed, 10 insertions(+), 8 deletions(-)
>
> diff --git a/notmuch-new.c b/notmuch-new.c
> index cc680b412a45..13212639cc8e 100644
> --- a/notmuch-new.c
> +++ b/notmuch-new.c
> @@ -738,18 +738,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.10.2
>
> _______________________________________________
> notmuch mailing list
> notmuch@notmuchmail.org
> https://notmuchmail.org/mailman/listinfo/notmuch

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] cli: don't call _entry_in_ignore_list twice in count files debug
  2016-12-17 16:28 [PATCH] cli: don't call _entry_in_ignore_list twice in count files debug Jani Nikula
  2017-01-25 20:18 ` Tomi Ollila
@ 2017-01-28  2:31 ` David Bremner
  1 sibling, 0 replies; 3+ messages in thread
From: David Bremner @ 2017-01-28  2:31 UTC (permalink / raw)
  To: Jani Nikula, notmuch

Jani Nikula <jani@nikula.org> writes:

> 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.

pushed to master

d

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-01-28  2:31 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-12-17 16:28 [PATCH] cli: don't call _entry_in_ignore_list twice in count files debug Jani Nikula
2017-01-25 20:18 ` Tomi Ollila
2017-01-28  2:31 ` David Bremner

Code repositories for project(s) associated with this public inbox

	https://yhetil.org/notmuch.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).