unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
From: Tomi Ollila <tomi.ollila@iki.fi>
To: Austin Clements <amdragon@MIT.EDU>, notmuch@notmuchmail.org
Subject: Re: [PATCH v2] tag: Automatically limit to messages whose tags will actually change.
Date: Wed, 16 Nov 2011 19:41:23 +0200	[thread overview]
Message-ID: <yf6hb24rmm4.fsf@taco2.nixu.fi> (raw)
In-Reply-To: <1320846275-28520-1-git-send-email-amdragon@mit.edu>

On Wed,  9 Nov 2011 08:44:35 -0500, Austin Clements <amdragon@MIT.EDU> wrote:
> This optimizes the user's tagging query to exclude messages that won't
> be affected by the tagging operation, saving computation and IO for
> redundant tagging operations.
> 
> For example,
>   notmuch tag +notmuch to:notmuch@notmuchmail.org
> will now use the query
>   ( to:notmuch@notmuchmail.org ) and (not tag:"notmuch")
> 
> In the past, we've often suggested that people do this exact
> transformation by hand for slow tagging operations.  This makes that
> unnecessary.
> ---
> This version addresses Jani's comments.
> 
>  NEWS          |    9 ++++++
>  notmuch-tag.c |   85 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++
>  2 files changed, 94 insertions(+), 0 deletions(-)
> 

Reviewed code, looks good

* Empty query string checked before entering _optimize_tag_query
  (if that matters)
* All allocations checked
* The logic look sound and creation of that query string is ok, too.
* I trust escaping is done the way it is done (quotes around, doubling
  any quotes (") in string).

* orig_query_string could be freed in _optimize_query_string()
  the data becomes garbage pointer to it lost after that call.
  However, _optimize_query_string() doesn't know that so it is
  better to leave talloc do the freeing (a bit later).

Tomi

  reply	other threads:[~2011-11-16 17:41 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-11-08  3:55 [PATCH] tag: Automatically limit to messages whose tags will actually change Austin Clements
2011-11-08  4:34 ` Dmitry Kurochkin
2011-11-08 16:10   ` Austin Clements
2011-11-08 10:41 ` Sebastian Spaeth
2011-11-09  8:46 ` Jani Nikula
2011-11-09 13:40   ` Austin Clements
2011-11-10 13:28   ` Sebastian Spaeth
2012-11-06  1:56     ` David Bremner
2011-11-09 13:44 ` [PATCH v2] " Austin Clements
2011-11-16 17:41   ` Tomi Ollila [this message]
2011-11-28 15:46   ` David Bremner

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=yf6hb24rmm4.fsf@taco2.nixu.fi \
    --to=tomi.ollila@iki.fi \
    --cc=amdragon@MIT.EDU \
    --cc=notmuch@notmuchmail.org \
    /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).