1 Return-Path: <tomi.ollila@nixu.com>
\r
2 X-Original-To: notmuch@notmuchmail.org
\r
3 Delivered-To: notmuch@notmuchmail.org
\r
4 Received: from localhost (localhost [127.0.0.1])
\r
5 by olra.theworths.org (Postfix) with ESMTP id B0894431FD0
\r
6 for <notmuch@notmuchmail.org>; Tue, 23 Aug 2011 23:30:39 -0700 (PDT)
\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org
\r
11 X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[none]
\r
13 Received: from olra.theworths.org ([127.0.0.1])
\r
14 by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)
\r
15 with ESMTP id dZlsIRxGLwQZ for <notmuch@notmuchmail.org>;
\r
16 Tue, 23 Aug 2011 23:30:38 -0700 (PDT)
\r
17 Received: from taco2.nixu.fi (taco2.nixu.fi [194.197.118.31])
\r
18 (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
\r
19 (No client certificate requested)
\r
20 by olra.theworths.org (Postfix) with ESMTPS id 64EF7431FB6
\r
21 for <notmuch@notmuchmail.org>; Tue, 23 Aug 2011 23:30:38 -0700 (PDT)
\r
22 Received: from taco2.nixu.fi (localhost [127.0.0.1])
\r
23 by taco2.nixu.fi (8.14.3/8.14.3/Debian-5+lenny1) with ESMTP id
\r
25 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT);
\r
26 Wed, 24 Aug 2011 09:30:26 +0300
\r
27 Received: (from too@localhost)
\r
28 by taco2.nixu.fi (8.14.3/8.14.3/Submit) id p7O6UOLg001010;
\r
29 Wed, 24 Aug 2011 09:30:24 +0300
\r
30 X-Authentication-Warning: taco2.nixu.fi: too set sender to
\r
31 tomi.ollila@nixu.com using -f
\r
32 From: Tomi Ollila <tomi.ollila@nixu.com>
\r
33 To: James Vasile <james@hackervisions.org>
\r
34 Subject: Re: [PATCH] Skip dot files in `notmuch new`
\r
35 References: <8762lnwtva.fsf@hackervisions.org>
\r
36 X-Face: HhBM'cA~<r"^Xv\KRN0P{vn'Y"Kd;zg_y3S[4)KSN~s?O\"QPoL
\r
37 $[Xv_BD:i/F$WiEWax}R(MPS`^UaptOGD`*/=@\1lKoVa9tnrg0TW?"r7aRtgk[F
\r
38 !)g;OY^,BjTbr)Np:%c_o'jj,Z
\r
39 Date: Wed, 24 Aug 2011 09:30:24 +0300
\r
40 In-Reply-To: <8762lnwtva.fsf@hackervisions.org> (James Vasile's message of
\r
41 "Tue, 23 Aug 2011 20:11:53 -0400")
\r
42 Message-ID: <yf6ippncoe7.fsf@taco2.nixu.fi>
\r
43 User-Agent: Gnus/5.110014 (No Gnus v0.14) Emacs/22.2 (gnu/linux)
\r
45 Content-Type: text/plain
\r
46 Cc: notmuch@notmuchmail.org
\r
47 X-BeenThere: notmuch@notmuchmail.org
\r
48 X-Mailman-Version: 2.1.13
\r
50 List-Id: "Use and development of the notmuch mail system."
\r
51 <notmuch.notmuchmail.org>
\r
52 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,
\r
53 <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>
\r
54 List-Archive: <http://notmuchmail.org/pipermail/notmuch>
\r
55 List-Post: <mailto:notmuch@notmuchmail.org>
\r
56 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>
\r
57 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,
\r
58 <mailto:notmuch-request@notmuchmail.org?subject=subscribe>
\r
59 X-List-Received-Date: Wed, 24 Aug 2011 06:30:40 -0000
\r
61 On Wed 24 Aug 2011 03:11, James Vasile <james@hackervisions.org> writes:
\r
63 > No known mail client or fetch tool stores mail in dot files, because
\r
64 > files that start with '.' are usually used to store metadata
\r
65 > (i.e. state or configuration) as opposed to subject-matter data.
\r
67 > Some mail fetch tools (including mbsync) and clients use dot files in
\r
68 > maildirs to store metadata. Notmuch should not warn that it is
\r
69 > ignoring these files, since it *should* ignore them. Indeed, it
\r
70 > should ignore all dot files.
\r
72 > notmuch-new.c | 4 ++++
\r
73 > 1 files changed, 4 insertions(+), 0 deletions(-)
\r
75 > diff --git a/notmuch-new.c b/notmuch-new.c
\r
76 > index 7d17793..87ee07e 100644
\r
77 > --- a/notmuch-new.c
\r
78 > +++ b/notmuch-new.c
\r
79 > @@ -428,6 +428,10 @@ add_files_recursive (notmuch_database_t *notmuch,
\r
83 > + /* Don't add dot files. */
\r
84 > + if (entry->d_name[0] == '.')
\r
87 > /* We're now looking at a regular file that doesn't yet exist
\r
88 > * in the database, so add it. */
\r
89 > next = talloc_asprintf (notmuch, "%s/%s", path, entry->d_name);
\r
93 yesterday, when I was checking code for something else I was thinking
\r
94 the same issue: Instead of the above the code sections:
\r
96 /* XXX: Eventually we'll want more sophistication to let the
\r
97 * user specify files to be ignored. */
\r
98 if (strcmp (entry->d_name, ".") == 0 ||
\r
99 strcmp (entry->d_name, "..") == 0 ||
\r
100 (is_maildir && strcmp (entry->d_name, "tmp") == 0) ||
\r
101 strcmp (entry->d_name, ".notmuch") ==0)
\r
107 /* XXX: Eventually we'll want more sophistication to let the
\r
108 * user specify files to be ignored. */
\r
109 if (strcmp (entry->d_name, ".") == 0 ||
\r
110 strcmp (entry->d_name, "..") == 0 ||
\r
111 strcmp (entry->d_name, ".notmuch") == 0)
\r
116 Could be simplified to check just starting dot (.) (and tmp
\r
117 in add_files_recursive() in case of is_maildir). Maybe
\r
118 the count_files() function (the latter one above) should
\r
119 also do the same check so that the numbers count_files()
\r
120 and add_files() are (almost the) same, causing less confusion
\r
123 I personally don't want to *exclude* more -- I was planning
\r
124 to hack in code that only include a list of directories under
\r
125 top level 'db_path'.
\r