unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
* [PATCH] nmbug: allow excluded messages
@ 2016-10-22  7:59 Mark Walters
  2016-10-22  8:23 ` David Bremner
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Mark Walters @ 2016-10-22  7:59 UTC (permalink / raw)
  To: notmuch

This makes nmbug work even if the notmuch mailing list messages are
excluded (i.e., have a tag in the excluded tags list).
---

I keep all my mailing list emails under an excluded tag (initially
this was to test the exclude code thoroughly, but I find it convenient
to keep day to day email and mailing list email separate). However,
this confuses nmbug -- would the following patch be acceptable?

(I think this is the only place it is needed, but I don't use nmbug
much so I haven't tested thoroughly.)

Best wishes

Mark

devel/nmbug/nmbug | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/devel/nmbug/nmbug b/devel/nmbug/nmbug
index 6febf16..dc565c4 100755
--- 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)
         if stdout:
-- 
2.1.4

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH] nmbug: allow excluded messages
  2016-10-22  7:59 [PATCH] nmbug: allow excluded messages Mark Walters
@ 2016-10-22  8:23 ` David Bremner
  2016-10-22 11:00 ` Tomi Ollila
  2016-10-22 21:39 ` W. Trevor King
  2 siblings, 0 replies; 6+ messages in thread
From: David Bremner @ 2016-10-22  8:23 UTC (permalink / raw)
  To: Mark Walters, notmuch

Mark Walters <markwalters1009@gmail.com> writes:

> This makes nmbug work even if the notmuch mailing list messages are
> excluded (i.e., have a tag in the excluded tags list).
> ---
>
> I keep all my mailing list emails under an excluded tag (initially
> this was to test the exclude code thoroughly, but I find it convenient
> to keep day to day email and mailing list email separate). However,
> this confuses nmbug -- would the following patch be acceptable?
>
> (I think this is the only place it is needed, but I don't use nmbug
> much so I haven't tested thoroughly.)

No objections from me.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] nmbug: allow excluded messages
  2016-10-22  7:59 [PATCH] nmbug: allow excluded messages Mark Walters
  2016-10-22  8:23 ` David Bremner
@ 2016-10-22 11:00 ` Tomi Ollila
  2016-10-22 21:39 ` W. Trevor King
  2 siblings, 0 replies; 6+ messages in thread
From: Tomi Ollila @ 2016-10-22 11:00 UTC (permalink / raw)
  To: Mark Walters, notmuch

On Sat, Oct 22 2016, Mark Walters <markwalters1009@gmail.com> 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 keep all my mailing list emails under an excluded tag (initially
> this was to test the exclude code thoroughly, but I find it convenient
> to keep day to day email and mailing list email separate). However,
> this confuses nmbug -- would the following patch be acceptable?

+1

Tomi


>
> (I think this is the only place it is needed, but I don't use nmbug
> much so I haven't tested thoroughly.)
>
> Best wishes
>
> Mark
>
> devel/nmbug/nmbug | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/devel/nmbug/nmbug b/devel/nmbug/nmbug
> index 6febf16..dc565c4 100755
> --- 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)
>          if stdout:
> -- 
> 2.1.4
>
> _______________________________________________
> notmuch mailing list
> notmuch@notmuchmail.org
> https://notmuchmail.org/mailman/listinfo/notmuch

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] nmbug: allow excluded messages
  2016-10-22  7:59 [PATCH] nmbug: allow excluded messages Mark Walters
  2016-10-22  8:23 ` David Bremner
  2016-10-22 11:00 ` Tomi Ollila
@ 2016-10-22 21:39 ` W. Trevor King
  2016-10-23  0:05   ` David Bremner
  2 siblings, 1 reply; 6+ messages in thread
From: W. Trevor King @ 2016-10-22 21:39 UTC (permalink / raw)
  To: Mark Walters; +Cc: notmuch

[-- Attachment #1: Type: text/plain, Size: 1419 bytes --]

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.

Anyhow, the idea looks good to me.  I'm just not clear enough on
exclude handling to know if this patch sufficiently covers it.

Cheers,
Trevor

-- 
This email may be signed or encrypted with GnuPG (http://www.gnupg.org).
For more information, see http://en.wikipedia.org/wiki/Pretty_Good_Privacy

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] nmbug: allow excluded messages
  2016-10-22 21:39 ` W. Trevor King
@ 2016-10-23  0:05   ` David Bremner
  2016-10-23  1:43     ` David Bremner
  0 siblings, 1 reply; 6+ messages in thread
From: David Bremner @ 2016-10-23  0:05 UTC (permalink / raw)
  To: W. Trevor King, Mark Walters; +Cc: notmuch

"W. Trevor King" <wking@tremily.us> 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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] nmbug: allow excluded messages
  2016-10-23  0:05   ` David Bremner
@ 2016-10-23  1:43     ` David Bremner
  0 siblings, 0 replies; 6+ messages in thread
From: David Bremner @ 2016-10-23  1:43 UTC (permalink / raw)
  To: W. Trevor King, Mark Walters; +Cc: notmuch

David Bremner <david@tethera.net> writes:

> "W. Trevor King" <wking@tremily.us> 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
excludes.

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.

d

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2016-10-23  1:43 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-10-22  7:59 [PATCH] nmbug: allow excluded messages Mark Walters
2016-10-22  8:23 ` David Bremner
2016-10-22 11:00 ` Tomi Ollila
2016-10-22 21:39 ` W. Trevor King
2016-10-23  0:05   ` David Bremner
2016-10-23  1:43     ` David Bremner

Code repositories for project(s) associated with this public inbox

	https://yhetil.org/notmuch.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).