> > 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. > > I sort of agree but wonder if it would be more natural under "new" than > "insert". so notmuch new /path/to/file just adds that file (provided it > is in the database; perhaps a relative path?) This would also be > extensible to do a whole mail sub-directory which seems like it might > also be a useful feature. (I am definitely not saying that this needs to > be implemented now!) That would be mostly welcome addition indeed ... Cheers -- Vlad