linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Joe Perches <joe@perches.com>
To: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>,
	Lukas Bulwahn <lukas.bulwahn@gmail.com>,
	Linus Torvalds <torvalds@linux-foundation.org>
Cc: Jonathan Corbet <corbet@lwn.net>,
	linux-doc@vger.kernel.org, linux-fsdevel@vger.kernel.org,
	kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] parse-maintainers: Do not sort section content by default
Date: Thu, 26 Mar 2020 09:45:55 -0700	[thread overview]
Message-ID: <00d11cf766237d9c12c2a06458962c4bae84fa78.camel@perches.com> (raw)
In-Reply-To: <4d5291fa3fb4962b1fa55e8fd9ef421ef0c1b1e5.camel@perches.com>

On Sat, 2020-03-07 at 18:59 -0800, Joe Perches wrote:
> Add an --order switch to control section reordering.
> Default for --order is off.

> Change the default ordering to a slightly more sensible:
> 
> M:  Person acting as a maintainer
> R:  Person acting as a patch reviewer
> L:  Mailing list where patches should be sent
> S:  Maintenance status
> W:  URI for general information
> Q:  URI for patchwork tracking
> B:  URI for bug tracking/submission
> C:  URI for chat
> P:  URI or file for subsystem specific coding styles
> T:  SCM tree type and location
> F:  File and directory pattern
> X:  File and directory exclusion pattern
> N:  File glob
> K:  Keyword - patch content regex

Linus? ping?

> Signed-off-by: Joe Perches <joe@perches.com>
> ---
>  scripts/parse-maintainers.pl | 31 +++++++++++++++++++++++++++----
>  1 file changed, 27 insertions(+), 4 deletions(-)
> 
> diff --git a/scripts/parse-maintainers.pl b/scripts/parse-maintainers.pl
> index 255cef1..2ca4eb3 100644
> --- a/scripts/parse-maintainers.pl
> +++ b/scripts/parse-maintainers.pl
> @@ -8,13 +8,14 @@ my $input_file = "MAINTAINERS";
>  my $output_file = "MAINTAINERS.new";
>  my $output_section = "SECTION.new";
>  my $help = 0;
> -
> +my $order = 0;
>  my $P = $0;
>  
>  if (!GetOptions(
>  		'input=s' => \$input_file,
>  		'output=s' => \$output_file,
>  		'section=s' => \$output_section,
> +		'order!' => \$order,
>  		'h|help|usage' => \$help,
>  	    )) {
>      die "$P: invalid argument - use --help if necessary\n";
> @@ -32,6 +33,22 @@ usage: $P [options] <pattern matching regexes>
>    --input => MAINTAINERS file to read (default: MAINTAINERS)
>    --output => sorted MAINTAINERS file to write (default: MAINTAINERS.new)
>    --section => new sorted MAINTAINERS file to write to (default: SECTION.new)
> +  --order => Use the preferred section content output ordering (default: 0)
> +    Preferred ordering of section output is:
> +      M:  Person acting as a maintainer
> +      R:  Person acting as a patch reviewer
> +      L:  Mailing list where patches should be sent
> +      S:  Maintenance status
> +      W:  URI for general information
> +      Q:  URI for patchwork tracking
> +      B:  URI for bug tracking/submission
> +      C:  URI for chat
> +      P:  URI or file for subsystem specific coding styles
> +      T:  SCM tree type and location
> +      F:  File and directory pattern
> +      X:  File and directory exclusion pattern
> +      N:  File glob
> +      K:  Keyword - patch content regex
>  
>  If <pattern match regexes> exist, then the sections that match the
>  regexes are not written to the output file but are written to the
> @@ -56,7 +73,7 @@ sub by_category($$) {
>  
>  sub by_pattern($$) {
>      my ($a, $b) = @_;
> -    my $preferred_order = 'MRPLSWTQBCFXNK';
> +    my $preferred_order = 'MRLSWQBCPTFXNK';
>  
>      my $a1 = uc(substr($a, 0, 1));
>      my $b1 = uc(substr($b, 0, 1));
> @@ -105,8 +122,14 @@ sub alpha_output {
>  		print $file $separator;
>  	    }
>  	    print $file $key . "\n";
> -	    foreach my $pattern (sort by_pattern split('\n', %$hashref{$key})) {
> -		print $file ($pattern . "\n");
> +	    if ($order) {
> +		foreach my $pattern (sort by_pattern split('\n', %$hashref{$key})) {
> +		    print $file ($pattern . "\n");
> +		}
> +	    } else {
> +		foreach my $pattern (split('\n', %$hashref{$key})) {
> +		    print $file ($pattern . "\n");
> +		}
>  	    }
>  	}
>      }
> 


  reply	other threads:[~2020-03-26 16:47 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-04  7:29 [PATCH] MAINTAINERS: adjust to filesystem doc ReST conversion Lukas Bulwahn
2020-03-04  7:59 ` Mauro Carvalho Chehab
2020-03-04 10:54   ` Lukas Bulwahn
2020-03-04 20:10 ` Jonathan Corbet
2020-03-04 20:24   ` Joe Perches
2020-03-04 20:28   ` Mauro Carvalho Chehab
2020-03-04 21:02     ` Lukas Bulwahn
2020-03-04 21:24     ` Joe Perches
2020-03-05  6:14       ` Mauro Carvalho Chehab
2020-03-04 20:50   ` Lukas Bulwahn
2020-03-04 21:01     ` Jonathan Corbet
2020-03-04 22:57     ` Joe Perches
2020-03-06 21:17       ` Lukas Bulwahn
2020-03-07 10:01         ` Mauro Carvalho Chehab
2020-03-07 15:12           ` Joe Perches
2020-03-08  2:59             ` [PATCH] parse-maintainers: Do not sort section content by default Joe Perches
2020-03-26 16:45               ` Joe Perches [this message]
2020-03-26 22:54                 ` Linus Torvalds

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=00d11cf766237d9c12c2a06458962c4bae84fa78.camel@perches.com \
    --to=joe@perches.com \
    --cc=corbet@lwn.net \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lukas.bulwahn@gmail.com \
    --cc=mchehab+huawei@kernel.org \
    --cc=torvalds@linux-foundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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 NNTP newsgroup(s).