From: David Bremner <david@tethera.net>
To: "Alexey I. Froloff" <raorn@raorn.name>, notmuch@notmuchmail.org
Subject: Re: [PATCH] lib: Add a new prefix "list" to the search-terms syntax
Date: Mon, 29 Apr 2013 22:12:16 -0300 [thread overview]
Message-ID: <87vc74vn2n.fsf@zancas.localnet> (raw)
In-Reply-To: <1365549369-12776-1-git-send-email-raorn@raorn.name>
Hi Alexey,
Thanks for working on this. I think the boolean prefix version makes
more sense, and it seems to work OK. I have a few comments below
"Alexey I. Froloff" <raorn@raorn.name> writes:
> + begin_list_id = strrchr (list_id_header, '<');
> + if (!begin_list_id) {
> + fprintf (stderr, "Warning: Not indexing mailformed List-Id tag.\n");
> + return;
> + }
- I guess this should say "malformed".
- I got about 1800 lines of such messages when indexing 280k
messages. That might strike some people as excessive. On the otherhand
I guess we need to re-think error reporting overall.
What do you think about printing filename or message-id here its
easier to double check that it is not a bug?
> + end_list_id = strrchr(begin_list_id, '>');
> + if (!end_list_id || (end_list_id - begin_list_id < 2)) {
> + fprintf (stderr, "Warning: Not indexing mailformed List-Id tag.\n");
> + return;
> + }
> +
Same comments here.
> + void *local = talloc_new (message);
> +
> + /* We extract the list id between the angle brackets */
> + const char *list_id = talloc_strndup (local, begin_list_id + 1,
> + end_list_id - begin_list_id - 1);
> +
we should handle ENOMEM here, I think.
> + /* _notmuch_message_add_term() may return
> + * NOTMUCH_PRIVATE_STATUS_TERM_TOO_LONG here. We can't fix it, but
> + * this is not a reason to exit with error... */
> + if (_notmuch_message_add_term (message, "list", list_id))
> + fprintf (stderr, "Warning: Not indexing List-Id: <%s>\n", list_id);
This should say why the indexing failed.
Other than that:
- We need a couple tests for this code; tests/search should give some
hints how to proceed.
- We need a patch for NEWS, explaining what people need to do take
advantage of the new functionality. I think that adding new prefixes
to an existing database is OK, but I'd welcome confirmation.
BTW, my not too scientific tests show no detectable bloat in the
database, at least after running xapian-compact. I'd be curious what
other people report.
next prev parent reply other threads:[~2013-04-30 1:12 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-04-03 13:46 [PATCH] lib: Add a new prefix "list" to the search-terms syntax Alexey I. Froloff
2013-04-06 11:54 ` David Bremner
2013-04-08 10:03 ` Alexey I. Froloff
2013-04-08 21:56 ` David Bremner
2013-04-09 8:30 ` Alexey I. Froloff
2013-04-09 23:16 ` Alexey I. Froloff
2013-04-30 1:12 ` David Bremner [this message]
2013-04-30 9:52 ` Alexey I. Froloff
2013-05-04 0:54 ` David Bremner
2013-10-17 14:17 ` Jani Nikula
2013-12-17 18:03 ` Kirill A. Shutemov
2013-12-17 19:46 ` Kirill A. Shutemov
2014-01-01 12:04 ` Jani Nikula
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=87vc74vn2n.fsf@zancas.localnet \
--to=david@tethera.net \
--cc=notmuch@notmuchmail.org \
--cc=raorn@raorn.name \
/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).