[notmuch] [patch] store folder information

micah anderson micah at riseup.net
Wed Jan 27 07:55:55 PST 2010


Hi Andreas,

I'm just writing because of the patch you sent to the notmuch list on
December 15th. It seems like many people are wanting this functionality,
I know I am myself and Carl has also indicated the same. However, there
were a couple of minor suggestions for improvements for your patch that
have not seen a reply from you yet. I'm particularly eager to see this
get accepted upstream, and it sounds like the changes necessary to do so
are relatively minor.

I'm wondering what your plans are for addressing these issues? I've come
to depend on this functionality, and would love to see it incorporated
upstream! 

Specifically these were:

1. Unrelated whitespace:

On December 16th,2009 Ruben Pollan <meskio at sindominio.net> wrote:

> [meskio at blackspot:src/notmuch.orig]$ git apply ~/0001-Preseve-folder-information-when-indexing.patch
> /home/meskio/0001-Preseve-folder-information-when-indexing.patch:136: trailing whitespace.
>		 status notmuch_database_add_message (notmuch, next,
> /home/meskio/0001-Preseve-folder-information-when-indexing.patch:137: trailing whitespace.
>							folder_base_name,
> warning: 2 lines add whitespace errors.
>
> It's just whitespaces at the end of the lines.

2. An unrelated hunk creeping in:

On Tue, 15 Dec 2009 13:22:19 -0800, Carl Worth <cworth at cworth.org> wrote:
> On Mon, 14 Dec 2009 14:21:50 -0500, Andreas Kl=C3=B6ckner <lists at informa.=
tiker.net> wrote:
> >
> > @@ -116,6 +116,8 @@ skip_re_in_subject (const char *subject)
> >  	    s++;
> >  	if (strncasecmp (s, "re:", 3) =3D=3D 0)
> >  	    s +=3D 3;
> > +        else if (strncasecmp (s, "aw:", 3) =3D=3D 0)
> > +	    s +=3D 3;
> >  	else
> >  	    break;
> >      }
>=20
> This hunk looks unrelated to the rest. Could you submit that separately,
> please?


3. Redundant trailing directory name traversal:

> > +    gchar *full_folder_name =3D NULL;
> > +    gchar *folder_base_name =3D NULL;
> > +
> > +    /* Find name of "folder" containing the email. */
> > +    full_folder_name =3D g_strdup(path);
> > +    while (1)
> > +    {
> > +        folder_base_name =3D g_path_get_basename(full_folder_name);
>
> The trailing directory name is available already during the
> traversal. So you don't need to search it back out again. See the patch
> in the following message:
>
> 	id:87fx8bygi7.fsf at linux.vnet.ibm.com
>
> which simply passes the trailing directory name along, (but skipping a
> name of "cur" or "new" while traversing).

4. supporting hierarchical folders (perhaps this is a later improvement
that does not need to be added before the original patch is accepted?):

> Beyond that, though, I imagine some people have hierarchical folders as
> well, so it probably makes sense to store them as well.
>
> To do that, it's probably just a matter of calling gen_terms on the
> complete filename. I haven't tested, but doing that should allow
> Xapian's phrase searching to do the right thing for something like:
>
> 	filename:portion/of/the/path/name

5. Probably the patch needs to be rebased off of master at this point.

Micah
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 835 bytes
Desc: not available
URL: <http://notmuchmail.org/pipermail/notmuch/attachments/20100128/7c173e7f/attachment.pgp>


More information about the notmuch mailing list