[PATCH] Skip dot files in `notmuch new`

2011-09-02 Thread Tomi Ollila
On Fri 02 Sep 2011 03:52, Tom Prince  writes:

> On Tue, 23 Aug 2011 20:11:53 -0400, James Vasile  
> wrote:
>> No known mail client or fetch tool stores mail in dot files, because
>> files that start with '.' are usually used to store metadata
>> (i.e. state or configuration) as opposed to subject-matter data.
>
> Dovecot stores folders in directories starting with . though.

Just yesterday on irc I saw someone using ~/.mail/.sent/ though.

>   Tom

Tomi


[PATCH] Skip dot files in `notmuch new`

2011-09-01 Thread Tom Prince
On Tue, 23 Aug 2011 20:11:53 -0400, James Vasile  
wrote:
> No known mail client or fetch tool stores mail in dot files, because
> files that start with '.' are usually used to store metadata
> (i.e. state or configuration) as opposed to subject-matter data.

Dovecot stores folders in directories starting with . though.

  Tom


Re: [PATCH] Skip dot files in `notmuch new`

2011-09-01 Thread Tom Prince
On Tue, 23 Aug 2011 20:11:53 -0400, James Vasile ja...@hackervisions.org 
wrote:
 No known mail client or fetch tool stores mail in dot files, because
 files that start with '.' are usually used to store metadata
 (i.e. state or configuration) as opposed to subject-matter data.

Dovecot stores folders in directories starting with . though.

  Tom
___
notmuch mailing list
notmuch@notmuchmail.org
http://notmuchmail.org/mailman/listinfo/notmuch


Re: [PATCH] Skip dot files in `notmuch new`

2011-09-01 Thread Tomi Ollila
On Fri 02 Sep 2011 03:52, Tom Prince tom.pri...@ualberta.net writes:

 On Tue, 23 Aug 2011 20:11:53 -0400, James Vasile ja...@hackervisions.org 
 wrote:
 No known mail client or fetch tool stores mail in dot files, because
 files that start with '.' are usually used to store metadata
 (i.e. state or configuration) as opposed to subject-matter data.

 Dovecot stores folders in directories starting with . though.

Just yesterday on irc I saw someone using ~/.mail/.sent/ though.

   Tom

Tomi
___
notmuch mailing list
notmuch@notmuchmail.org
http://notmuchmail.org/mailman/listinfo/notmuch


[PATCH] Skip dot files in `notmuch new`

2011-08-24 Thread Tomi Ollila
On Wed 24 Aug 2011 03:11, James Vasile  writes:

> No known mail client or fetch tool stores mail in dot files, because
> files that start with '.' are usually used to store metadata
> (i.e. state or configuration) as opposed to subject-matter data.
>
> Some mail fetch tools (including mbsync) and clients use dot files in
> maildirs to store metadata.  Notmuch should not warn that it is
> ignoring these files, since it *should* ignore them.  Indeed, it
> should ignore all dot files.
> ---
>  notmuch-new.c |4 
>  1 files changed, 4 insertions(+), 0 deletions(-)
>
> diff --git a/notmuch-new.c b/notmuch-new.c
> index 7d17793..87ee07e 100644
> --- a/notmuch-new.c
> +++ b/notmuch-new.c
> @@ -428,6 +428,10 @@ add_files_recursive (notmuch_database_t *notmuch,
>   continue;
>   }
>  
> + /* Don't add dot files. */
> + if (entry->d_name[0] == '.')
> + continue;
> +
>   /* We're now looking at a regular file that doesn't yet exist
>* in the database, so add it. */
>   next = talloc_asprintf (notmuch, "%s/%s", path, entry->d_name);
> -- 
> 1.7.5.4

yesterday, when I was checking code for something else I was thinking
the same issue: Instead of the above the code sections:

/* XXX: Eventually we'll want more sophistication to let the
 * user specify files to be ignored. */
if (strcmp (entry->d_name, ".") == 0 ||
strcmp (entry->d_name, "..") == 0 ||
(is_maildir && strcmp (entry->d_name, "tmp") == 0) ||
strcmp (entry->d_name, ".notmuch") ==0)
{
continue;
}

and
/* XXX: Eventually we'll want more sophistication to let the
 * user specify files to be ignored. */
if (strcmp (entry->d_name, ".") == 0 ||
strcmp (entry->d_name, "..") == 0 ||
strcmp (entry->d_name, ".notmuch") == 0)
{
continue;
}

Could be simplified to check just starting dot (.) (and tmp
in add_files_recursive() in case of is_maildir). Maybe
the count_files() function (the latter one above) should
also do the same check so that the numbers count_files()
and add_files() are (almost the) same, causing less confusion
to the user.

I personally don't want to *exclude* more -- I was planning
to hack in code that only include a list of directories under
top level 'db_path'. 


Tomi


[PATCH] Skip dot files in `notmuch new`

2011-08-23 Thread James Vasile
No known mail client or fetch tool stores mail in dot files, because
files that start with '.' are usually used to store metadata
(i.e. state or configuration) as opposed to subject-matter data.

Some mail fetch tools (including mbsync) and clients use dot files in
maildirs to store metadata.  Notmuch should not warn that it is
ignoring these files, since it *should* ignore them.  Indeed, it
should ignore all dot files.
---
 notmuch-new.c |4 
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/notmuch-new.c b/notmuch-new.c
index 7d17793..87ee07e 100644
--- a/notmuch-new.c
+++ b/notmuch-new.c
@@ -428,6 +428,10 @@ add_files_recursive (notmuch_database_t *notmuch,
continue;
}

+   /* Don't add dot files. */
+   if (entry->d_name[0] == '.')
+   continue;
+
/* We're now looking at a regular file that doesn't yet exist
 * in the database, so add it. */
next = talloc_asprintf (notmuch, "%s/%s", path, entry->d_name);
-- 
1.7.5.4