nmh-workers
[Top] [All Lists]

Re: [nmh-workers] Stupid 'pick' question...

2019-06-08 19:18:28
On Jun 8, 2019, at 11:03 AM, Valdis Klētnieks <valdis.kletnieks@vt.edu> wrote:

On Fri, 07 Jun 2019 16:19:15 -0700, Bakul Shah said:
You can directly use search as follows:

     -search 'Subject[ \t]:[ \t]*\[PATCH [45]\.[0-9]'

[~] grep ^Subject Mail/linux-kernel/321805
Subject: Re: [PATCH 4.9 04/20] net: Fix for_each_netdev_feature on Big endian
[~] scan `pick +linux-kernel 321805 -search 'Subject: \[PATCH [45]\.[0-9]' 
-and -from gregkh@linuxfoundation.org -list`
321805      *  Thu 21Feb      7k Greg Kroah-Hartma  Re: [PATCH 4.9 04/20] 
net: Fix for_each_netdev_feature on Big endian <<On Thu, Feb 21,
[~] scan `pick +linux-kernel 321805 -search 'Subject: \[WOMBAT [45]\.[0-9]' 
-and -from gregkh@linuxfoundation.org -list`
pick: no messages match specification
scan: no messages match specification


Let us look at what you see (after some cleanup):

  $ grep ^Subject Mail/linux-kernel/321805
  Subject: Re: [PATCH 4.9 04/20] net: Fix for_each_netdev_feature on Big endian
  $ pick +linux-kernel 321805 -search 'Subject: \[PATCH [45]\.[0-9]' -and -from 
gregkh@linuxfoundation.org
  321805
  $ pick +linux-kernel 321805 -search 'Subject: \[WOMBAT [45]\.[0-9]' -and 
-from gregkh@linuxfoundation.org 
  pick: no messages match specification

This makes sense. But note that pick does treat header lines specially.
Using your message as an example:

  $ grep ^Subject: `mhpath cur`
  Subject: Re: [nmh-workers] Stupid 'pick' question...
  Subject: Re: [PATCH 4.9 04/20] net: Fix for_each_netdev_feature on Big endian

The second Subject: line is from the message body.

  $ pick -subj PATCH cur
  pick: no messages match specification
  $ pick -search 'Subject:.*PATH' cur
  14
  $ pick -search 'Subject:.*nmh' cur
  14

So pick runs -search on header lines as well as the body a header specific
option is only run against headers.

And pick matches header line *after* line folding, as tested with Received:

  pick --received 'bakul' cur -- matches but my name is not on the same line as 
Received:
  pick --received '\]\)' cur  -- match )] on the first line
  pick --received '\]\)$' cur -- no match even though the first Received: line 
ends wih )]
  pick --received '0400$' cur -- match as 0400 ends the last line of a 
Received: field.

Conclusion: the man page is not quite accurate! But that is probably ok. 


-- 
nmh-workers
https://lists.nongnu.org/mailman/listinfo/nmh-workers

<Prev in Thread] Current Thread [Next in Thread>