public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Joe Perches <joe@perches.com>
Cc: git@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH V2] git-send-email: Add ability to cc: any "bylines" in the commit message
Date: Wed, 31 Aug 2016 12:34:10 -0700	[thread overview]
Message-ID: <xmqq4m6020nh.fsf@gitster.mtv.corp.google.com> (raw)
In-Reply-To: <aa4c9e0b37e70423baa69bc27cc9adda0f152efe.1472669418.git.joe@perches.com> (Joe Perches's message of "Wed, 31 Aug 2016 11:51:19 -0700")

Joe Perches <joe@perches.com> writes:

> Many commits have various forms of bylines similar to

A missing blank line (I can tweak while queuing).

>      "Acked-by: Name <address>" and "Reported-by: Name <address>"
>
> Add the ability to cc: bylines (e.g. Acked-by:) when using git send-email.
>
> This can be suppressed with --suppress-cc=bylines.
> ...
> @@ -307,8 +308,10 @@ Automating
>    patch body (commit message) except for self (use 'self' for that).
>  - 'sob' will avoid including anyone mentioned in Signed-off-by lines except
>     for self (use 'self' for that).
> +- 'bylines' will avoid including anyone mentioned in any "<foo>-by:" lines
> +  in the patch header except for Signed-off-by.

<foo> feels a bit too informal but I don't think of a better
alternative, perhaps other than "*-by:".

> @@ -1545,7 +1545,7 @@ foreach my $t (@files) {
>  	# Now parse the message body
>  	while(<$fh>) {
>  		$message .=  $_;
> -		if (/^(Signed-off-by|Cc): (.*)$/i) {
> +		if (/^(Signed-off-by|Cc|[^\s]+[\w-]by): (.*)$/i) {

I thought you wanted

		if (/^(Signed-off-by|Cc|[\w-]+-by): (.*)$/i) {

instead to avoid "O_=:;fooby: Joe Perches <joe@...>"
>  			chomp;
>  			my ($what, $c) = ($1, $2);
>  			chomp $c;
> @@ -1555,6 +1555,12 @@ foreach my $t (@files) {
>  			} else {
>  				next if $suppress_cc{'sob'} and $what =~ /Signed-off-by/i;
>  				next if $suppress_cc{'bodycc'} and $what =~ /Cc/i;
> +				next if $suppress_cc{'bylines'} and $what !~ /Signed-off-by/i and $what =~ /by$/i;

Having to keep this /by$/i in sync with whatever definition of
bylines is will be error prone.  How about doing it in this way?

	# Now parse the message body
+	my $bypat = r/[\w-]+-by/;
	while (<$fh>) {
        	...
                if (/^(Signed-off-by|Cc|$bypat): (.*)$/i) {
                	...
                        	next if $suppress_cc{'bodycc'} and $what =~ /Cc/i;
+				next if $suppress_cc{'bylines'} and
+					$what !~ /^Signed-off-by/i and
+					$what =~ /^$bypat/i;

Other than that, looking good.

  reply	other threads:[~2016-08-31 19:35 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-31 18:51 [PATCH V2] git-send-email: Add ability to cc: any "bylines" in the commit message Joe Perches
2016-08-31 19:34 ` Junio C Hamano [this message]
2016-08-31 19:39   ` Joe Perches
2016-08-31 20:09     ` Junio C Hamano
2016-08-31 22:10 ` Jeff Kirsher

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=xmqq4m6020nh.fsf@gitster.mtv.corp.google.com \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=joe@perches.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