unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
From: Jani Nikula <jani@nikula.org>
To: Jameson Graef Rollins <jrollins@finestructure.net>,
	notmuch@notmuchmail.org
Subject: Re: [PATCH 6/8] cli: add support for batch tagging operations to "notmuch tag"
Date: Mon, 02 Apr 2012 22:46:15 +0300	[thread overview]
Message-ID: <87bon9apdk.fsf@nikula.org> (raw)
In-Reply-To: <87wr5y3ttw.fsf@servo.finestructure.net>

Jameson Graef Rollins <jrollins@finestructure.net> writes:

> On Sat, Mar 31 2012, Jani Nikula <jani@nikula.org> wrote:
>> Add support for batch tagging operations through stdin to "notmuch
>> tag". This can be enabled with the new --stdin command line option to
>> "notmuch new". The input must consist of lines of the format:
>>
>> T +<tag>|-<tag> [...] [--] <search-terms>
>
> Hey, Jani.  I can understand why you're going for this form, since it
> mimics the command line arguments for tag and you want to be able to tag
> for arbitrary searches, but I must say that I find it unappealing that
> this functionality is *so* similar to that of notmuch restore, but the
> file format is totally different.  Can't we unify all of this in a
> better way?

Hi Jameson -

Thanks for your comments. The intent is to converge notmuch tag and
restore file formats, and reuse the code between them. The above is the
proposed format for both, but I see that I failed to mention the future
plans.

This actually started from David's dump/restore rework [1]. I wanted to
have batch tagging, and realized his proposed format wouldn't work for
that. There was some discussion about this on IRC, and we settled on the
above format as a starting point. And now would be the time to comment
on the format, if you have any issues with it! ;)

> This patch series seems to beg that we actually just unify the tag and
> restore functions in to one thing.  They're really just doing the same
> thing.  If we extended restore to accept a search-term instead of a
> message id they would in fact be identical.
>
> The more I think about it the more it makes sense to me that we just
> merge tag and restore, and extend the input file format to be able to
> accept search terms.  It just doesn't make sense to have these two
> interfaces that do basically the exact same thing but in a slightly
> divergent way.

I totally agree on this goal. The dump/restore follow-up part is a
work-in-progress in my local tree. At least initially, the format would
be the same for tag and restore, but with the following subtle
differences:

1) notmuch restore will only accept an id:message-id style query to be
   able to warn about messages present in the dump file but missing in
   the database. This is because dump/restore is primarily a
   backup/restore style operation.

2) Partly because of the above, and partly because of notmuch restore
   --accumulate vs. not, the query/tagging optimizations will have to be
   different.

The rough idea is that both notmuch tag and restore would use the same
file parsing (tag_file() introduced in this series), but notmuch tag
would use tag_query() in notmuch-tag.c for tagging, and notmuch restore
would use tag_message() in notmuch-restore.c for tagging.

> and btw, according to comments in the code 'T' is supposed to stand for
> the action, "tag" in this case.  What other actions do you imagine?

This was actually David's idea. It allows extensibility in the format.

Thanks again for your interest, and sorry about not opening up the
future plans up front.


BR,
Jani.


[1] id:"1324214111-32079-1-git-send-email-david@tethera.net"

  reply	other threads:[~2012-04-02 19:46 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-31 22:17 [PATCH 0/8] batch tagging support: "notmuch tag --stdin" Jani Nikula
2012-03-31 22:17 ` [PATCH 1/8] hex-escape: (en|de)code strings to/from restricted character set Jani Nikula
2012-03-31 22:17 ` [PATCH 2/8] hex-escape: be more strict about the format while decoding Jani Nikula
2012-04-05 11:33   ` David Bremner
2012-04-05 11:49     ` Jani Nikula
2012-04-05 11:59       ` David Bremner
2012-03-31 22:17 ` [PATCH 3/8] hex-escape: add function to decode escaped string in-place Jani Nikula
2012-04-05 11:56   ` David Bremner
2012-04-05 12:00     ` Jani Nikula
2012-03-31 22:17 ` [PATCH 4/8] test/hex-xcode: new test binary Jani Nikula
2012-03-31 22:17 ` [PATCH 5/8] test/hex-escaping: new test for hex escaping routines Jani Nikula
2012-03-31 22:17 ` [PATCH 6/8] cli: add support for batch tagging operations to "notmuch tag" Jani Nikula
2012-04-02 17:51   ` Jameson Graef Rollins
2012-04-02 19:46     ` Jani Nikula [this message]
2012-04-02 17:54   ` Jameson Graef Rollins
2012-04-02 20:26     ` David Bremner
2012-04-02 20:42       ` Jameson Graef Rollins
2012-04-02 21:07         ` Jani Nikula
2012-04-02 21:20           ` Jameson Graef Rollins
2012-04-02 21:31             ` Jani Nikula
2012-04-02 21:43               ` Jameson Graef Rollins
2012-04-03  8:21                 ` Jani Nikula
2012-04-03 22:51                   ` Jameson Graef Rollins
2012-04-04  2:09                     ` David Bremner
2012-04-04  7:55                       ` Jameson Graef Rollins
2012-04-04 10:55                         ` David Bremner
2012-03-31 22:17 ` [PATCH 7/8] test: add test for notmuch tag --stdin option Jani Nikula
2012-03-31 22:17 ` [PATCH 8/8] man: document " 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=87bon9apdk.fsf@nikula.org \
    --to=jani@nikula.org \
    --cc=jrollins@finestructure.net \
    --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).