unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
From: David Bremner <david@tethera.net>
To: Jani Nikula <jani@nikula.org>, notmuch@notmuchmail.org
Subject: Re: [RFC 3/5] cli: support shell globbing patterns in new.ignore
Date: Sat, 11 Mar 2017 10:35:54 -0400	[thread overview]
Message-ID: <87wpbvrid1.fsf@tethera.net> (raw)
In-Reply-To: <51db8c12299cb1765d346fa2c93c6c95abb92613.1446579858.git.jani@nikula.org>

Jani Nikula <jani@nikula.org> writes:

> Keep the existing strcmp on the basename for backwards compatibility,
> and additionally use the new.ignore entries as fnmatch(3) patterns on
> the absolute filename. Note that it's not enough to add e.g. "foo*bar"
> to the list; you will need to do "*/foo*bar" to match the path also.

Are there (many?) fnmatch patterns that don't match themselves? I'm just
wondering if the extra strcmp is worth-it / needed?

>  
>  typedef struct _filename_node {
>      char *filename;
> @@ -236,15 +237,31 @@ _entries_resemble_maildir (const char *path, struct dirent **entries, int count)
>  /* Test if the file/directory is to be ignored.
>   */
>  static notmuch_bool_t
> -_entry_in_ignore_list (const char *entry, add_files_state_t *state)
> +_entry_in_ignore_list (const char *path, const char *entry,
> +		       add_files_state_t *state)
>  {

I was a bit confused when reading this (until I saw the calling
context). I guess path is dirname and entry is basename?

Other than needing doc and a test, I don't remember any objections to
this code, although I vaguely remember some alternative proposals for
ignoring?

I guess one point is that we are proposing to use regexps against paths
in one place [1] and proposing to use fnmatch here.  I'm not sure it's
worth trying to be more consistent, but now seems to be the time to
discuss. I think both places could use either, if someone did the
work. Of course the other argument is that the queries should be
consistent among themselves.

[1]: id:20170308024035.6149-1-david@tethera.net

  parent reply	other threads:[~2017-03-11 14:35 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-03 19:49 [RFC 0/5] globbing on new.ignore etc Jani Nikula
2015-11-03 19:49 ` [RFC 1/5] cli: fix function name in notmuch new debug logging Jani Nikula
2015-12-30 15:31   ` David Bremner
2015-11-03 19:49 ` [RFC 2/5] cli: don't call _entry_in_ignore_list twice in count files debug Jani Nikula
2016-04-09 23:56   ` David Bremner
2015-11-03 19:49 ` [RFC 3/5] cli: support shell globbing patterns in new.ignore Jani Nikula
2016-04-10  0:37   ` David Bremner
2017-03-11 14:35   ` David Bremner [this message]
2015-11-03 19:49 ` [RFC 4/5] cli: add notmuch config append command to append to string list configs Jani Nikula
2015-11-03 19:49 ` [RFC 5/5] cli: print number of ignored non-mails encountered in notmuch new scan Jani Nikula
2017-03-11 14:42   ` David Bremner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://notmuchmail.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87wpbvrid1.fsf@tethera.net \
    --to=david@tethera.net \
    --cc=jani@nikula.org \
    --cc=notmuch@notmuchmail.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).