Re: [PATCH 0/3] Introduce the add command

Subject: Re: [PATCH 0/3] Introduce the add command

Date: Fri, 19 Jul 2013 07:48:06 -0700

To: Adam Wolfe Gordon, notmuch@notmuchmail.org

Cc:

From: Jameson Graef Rollins


On Sat, Jul 13 2013, Adam Wolfe Gordon <awg+notmuch@xvx.ca> wrote:
> The recent introduction of insert inspired me to finally add a feature I've
> been wanting: a command to index a specific file in the maildir. My usecase
> for this is that I have an inotify-based script that watches for new mail
> and calls notmuch new when new mail shows up. Running notmuch new in this
> situation is overkill, since I know exactly what's changed. A faster command
> that just adds a single file reduces contention on the database lock.
>
> This series introduces a new command, "notmuch add", which indexes a file
> that already exists in the maildir. It is implemented in notmuch-insert.c
> because it uses the basic infrastructure introduced for the insert command.
>
> Missing man page for now - wanted to get the code out first for review.

Hey, Adam.  This feature seems fine, but it seems similar enought to
insert that I wonder if they can just be unified.  What if insert just
took an optional path argument as well, e.g.:

  notmuch insert [options] [ +<tag>|-<tag> ... ] [-- /path/to/file]

If the path is not in the db, it would insert it the same as if it had
come in via stdin.  If the path *is* in the db, it could just do the add
part that you're looking for.  That seems like it might be a more
intuitive UI experience to me.

jamie.
part-000.sig (application/pgp-signature)

Thread: