Re: [PATCH] nmbug: allow excluded messages

Subject: Re: [PATCH] nmbug: allow excluded messages

Date: Sat, 22 Oct 2016 22:43:33 -0300

To: W. Trevor King, Mark Walters


From: David Bremner

David Bremner <> writes:

> "W. Trevor King" <> writes:
>> On Sat, Oct 22, 2016 at 08:59:40AM +0100, Mark Walters wrote:
>>> This makes nmbug work even if the notmuch mailing list messages are
>>> excluded (i.e., have a tag in the excluded tags list).
>>> …
>>> (I think this is the only place it is needed, but I don't use nmbug
>>> much so I haven't tested thoroughly.)
>>> …
>>> --- a/devel/nmbug/nmbug
>>> +++ b/devel/nmbug/nmbug
>>> @@ -580,7 +580,7 @@ def get_status():
>>>      maybe_deleted = _diff_index(index=index, filter='D')
>>>      for id, tags in maybe_deleted.items():
>>>          (_, stdout, stderr) = _spawn(
>>> -            args=['notmuch', 'search', '--output=files', 'id:{0}'.format(id)],
>>> +            args=['notmuch', 'search', '--output=files', '--exclude=false', 'id:{0}'.format(id)],
>>>              stdout=_subprocess.PIPE,
>>>              wait=True)
>> Besides this call, we also use ‘notmuch search …’ in get_tags.  We may
>> need an --exclude=false there too to cover folks who exclude a tag
>> used by nmbug.
>> And ‘notmuch dump …’ doesn't appear to take an --exclude flag,
>> although it's based on searching so I'm not sure why not.
> the exclude API is opt in, so the default is no excludes

That was a bit terse, sorry. So the reason excludes don't matter for
dump and restore is because the dump and restore code doesn't set any

Trevor is probably correct about the other use of search also needing
the same flag.  I can also imagine someone with some
non-notmuch-bug-tracking use of nmbug wanting to have that configurable,
but I guess we could cross that bridge when we come to it.