mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Joe Perches <joe@perches.com>
To: Kai-Heng Feng <kai.heng.feng@canonical.com>
Cc: open list <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] get_maintainer: Append parenthesis back to trimmed subsystem name
Date: Wed, 04 Aug 2021 09:22:31 -0700	[thread overview]
Message-ID: <2d594d0b06401887debd5ec462edcffdc813318a.camel@perches.com> (raw)
In-Reply-To: <20210804160949.592227-1-kai.heng.feng@canonical.com>

On Thu, 2021-08-05 at 00:09 +0800, Kai-Heng Feng wrote:
> When a closing parenthesis gets trimmed, there can be unmatched
> parenthesis in the subsystem name. This doesn't play well with
> git-send-email:
> (cc-cmd) Adding cc: intel-gfx@lists.freedesktop.org (open list:INTEL DRM DRIVERS (excluding Poulsbo, Moorestow...) from: 'scripts/get_maintainer.pl'
> Unmatched () '(open list:INTEL DRM DRIVERS (excluding Poulsbo, Moorestow...)' '' at /usr/lib/git-core/git-send-email line 554.
> error: unable to extract a valid address from: intel-gfx@lists.freedesktop.org (open list:INTEL DRM DRIVERS (excluding Poulsbo, Moorestow...)
> 
> So append parenthesis back if it was trimmed to make git-send-email
> work again:
> (cc-cmd) Adding cc: intel-gfx@lists.freedesktop.org (open list:INTEL DRM DRIVERS (excluding Poulsbo, Mooresto...)) from: 'scripts/get_maintainer.pl'

Probably better just to add --norolestats to the invoking command-line.

> diff --git a/scripts/get_maintainer.pl b/scripts/get_maintainer.pl
[]
> @@ -1252,9 +1252,10 @@ sub get_subsystem_name {
>  
> 
>      my $subsystem = $typevalue[$start];
>      if ($output_section_maxlen && length($subsystem) > $output_section_maxlen) {
> -	$subsystem = substr($subsystem, 0, $output_section_maxlen - 3);
> +	my $parenthesis = substr($subsystem, -1) eq ")";
> +	$subsystem = substr($subsystem, 0, $output_section_maxlen - ($parenthesis ? 4 : 3));
>  	$subsystem =~ s/\s*$//;
> -	$subsystem = $subsystem . "...";
> +	$subsystem = $subsystem . "..." . ($parenthesis ? ")" : "");

Given an $output_section_maxlen number of possible parentheses, this should
probably use a while...



  reply	other threads:[~2021-08-04 16:22 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-04 16:09 Kai-Heng Feng
2021-08-04 16:22 ` Joe Perches [this message]
2021-08-05  6:17   ` Kai-Heng Feng
2021-08-05  6:33     ` Joe Perches
2021-08-05  6:44       ` Kai-Heng Feng

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=2d594d0b06401887debd5ec462edcffdc813318a.camel@perches.com \
    --to=joe@perches.com \
    --cc=kai.heng.feng@canonical.com \
    --cc=linux-kernel@vger.kernel.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

all inboxes | Powered by JetHome®