Re: tag sharing

Subject: Re: tag sharing

Date: Thu, 06 Oct 2011 21:10:50 -0300

To: Jesse Rosenthal, Jameson Graef Rollins, Notmuch Mail

Cc:

From: David Bremner


On Thu, 06 Oct 2011 16:40:00 -0400, Jesse Rosenthal <jrosenthal@jhu.edu> wrote:
> On Thu, 06 Oct 2011 17:23:21 -0300, David Bremner <david@tethera.net> wrote:
> > What doesn't work is searches for the whole namespace "notmuch search
> > tag:bremner.*" will return nothing, even though "notmuch search
> > tag:bremner.to-fix" does.
> 
> A simple shell way to do this would be
> 
>     notmuch search-tags | grep "^bremner\." | xargs -I {} notmuch search tag:{}
> 

Ah thanks, that is not so bad. It turns out to be literally a one line
change to add a query argument for notmuch-dump, _except_ that notmuch
dump already uses the first command line argument as an output file
name. I think I will start a seperate thread about that. If you want to
test, this works OK, except the output is put in a file named after the
query ;).

diff --git a/notmuch-dump.c b/notmuch-dump.c
index 7e7bc17..341207a 100644
--- a/notmuch-dump.c
+++ b/notmuch-dump.c
@@ -40,7 +40,7 @@ notmuch_dump_command (unused (void *ctx), int argc, char *argv[])
     if (notmuch == NULL)
 	return 1;
 
-    query = notmuch_query_create (notmuch, "");
+    query = notmuch_query_create (notmuch, argc > 0 ? argv[0] : "");
     if (query == NULL) {
 	fprintf (stderr, "Out of memory\n");
 	return 1;

Thread: