David gave some feedback to my old series to add globbing to new.ignore [1]. One thing that annoyed me in that series was that we have to do the ignore check in several places. I thought it would be nice to use the filter parameter to scandir(3) but alas you can't pass a context parameter there. I ended up experimenting with that, and here's the result. Maybe this makes it easier to read and understand the add_files() function, and this centralizes the new.ignore handling, but is this really worth it? I'm unsure. Patch 1 is trivial and should be pushed no matter what. BR, Jani. [1] id:871t6efgdt.fsf@maritornes.cs.unb.ca Jani Nikula (5): cli: remove leftover dir variable cli: drop inode sort order on directories unknown to the database util: add a homebrew scandir implementation cli: use homebrew scandir in notmuch new add_files cli: convert count_files to new scandir notmuch-new.c | 382 ++++++++++++++++++++++++++++------------------------ util/Makefile.local | 2 +- util/scandir.c | 87 ++++++++++++ util/scandir.h | 11 ++ 4 files changed, 305 insertions(+), 177 deletions(-) create mode 100644 util/scandir.c create mode 100644 util/scandir.h -- 2.1.4