finding incoming messages in threads in which i've participated [was: Re: find threads where I and Jian participated but not Dave]
Matt Armstrong
marmstrong at google.com
Mon Jun 26 13:54:08 PDT 2017
Daniel Kahn Gillmor <dkg at fifthhorseman.net> writes:
> Hey all--
>
> I really appreciate the thought and experimentation and research that's
> gone into this thread!
>
> On Thu 2017-06-22 17:00:58 -0700, Matt Armstrong wrote:
>> # All threads in which I participate get tag:participated
>> # 1) Find all threads with a message tagged new
>> # (finding all 'today' messages helps during testing,
>> # but isn't necessary)
>> # 2) Run through "xargs -s 2048 echo" to to group threads
>> # lines of about 2K in size.
>> # 3) For each line (2) produces, narrow the threads to
>> # those containing a message from me.
>> # 4) For each such thread, tag every message with +participated.
>> notmuch search --output=threads tag:new OR date:today | \
>> xargs -s 2048 echo | \
>> xargs -I '{}' notmuch search \
>> --output=threads from:marmstrong AND \( '{}' \) | \
>> sed -e 's,^,+participated -- ,' | \
>> notmuch tag --batch
>
> This makes sense to me, modulo the split into 2048-octet lines (magic
> numbers make me nervous, though i think i understand why you've included
> it).
Yes, the two xargs commands and "2048 business" is just a hack to work
around the documented limitations of "xargs -I". I'd love to come up
with a simpler way to do this. I suspect there is one, but when it
comes to this kind of Unix shell hackery, I usually stop once I get to
something that works. :)
More information about the notmuch
mailing list