]> git.cworth.org Git - notmuch/commitdiff
CLI/git: use --exclude=false when calling notmuch-search
authorDavid Bremner <david@tethera.net>
Sun, 16 Oct 2022 12:49:00 +0000 (09:49 -0300)
committerDavid Bremner <david@tethera.net>
Tue, 27 Dec 2022 15:54:57 +0000 (11:54 -0400)
We use notmuch search in two places in notmuch-git.py: to find which
tags have a given prefix, and to see if message with given id exists
locally. In both cases we do not want the presence of exclude tags
(e.g. deleted) to change the results.

notmuch-git.py

index ceb86fbc14dfa97db10dfec87732452a648edc0b..57098aae7821e5ddb5e1543d6e6c58d2c3d9a0bd 100644 (file)
@@ -254,7 +254,7 @@ def count_messages(prefix=None):
 def get_tags(prefix=None):
     "Get a list of tags with a given prefix."
     (status, stdout, stderr) = _spawn(
-        args=['notmuch', 'search', '--query=sexp', '--output=tags', _tag_query(prefix)],
+        args=['notmuch', 'search', '--exclude=false', '--query=sexp', '--output=tags', _tag_query(prefix)],
         stdout=_subprocess.PIPE, wait=True)
     return [tag for tag in stdout.splitlines()]
 
@@ -719,7 +719,7 @@ class DatabaseCache:
                 self._known[id] = False
         else:
             (_, stdout, stderr) = _spawn(
-                args=['notmuch', 'search', '--output=files', 'id:{0}'.format(id)],
+                args=['notmuch', 'search', '--exclude=false', '--output=files', 'id:{0}'.format(id)],
                 stdout=_subprocess.PIPE,
                 wait=True)
             self._known[id] = stdout != None