From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932687AbcHaTfJ (ORCPT ); Wed, 31 Aug 2016 15:35:09 -0400 Received: from pb-smtp1.pobox.com ([64.147.108.70]:59391 "EHLO sasl.smtp.pobox.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753384AbcHaTfH (ORCPT ); Wed, 31 Aug 2016 15:35:07 -0400 DomainKey-Signature: a=rsa-sha1; c=nofws; d=pobox.com; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type; q=dns; s=sasl; b=M53YDAZ3bgfnjjaYWLRlujM/UYhI0Yi4 Dz2HSXpFpX6xaScvsTeMEH46TKjMMJvsBGDINeBdjyxNXdAwycYaTKkY50DJ90rM iUfQr99MkmykTJLbqBUIXbGVaf9Wfdlr9YuFyNsD/6qNXq8Ug6e2h1igMqEStL7R yXWyAdXccPI= From: Junio C Hamano To: Joe Perches 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 References: Date: Wed, 31 Aug 2016 12:34:10 -0700 In-Reply-To: (Joe Perches's message of "Wed, 31 Aug 2016 11:51:19 -0700") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Pobox-Relay-ID: E5364A72-6FB1-11E6-A56C-F7BB12518317-77302942!pb-smtp1.pobox.com Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Joe Perches writes: > Many commits have various forms of bylines similar to A missing blank line (I can tweak while queuing). > "Acked-by: Name
" and "Reported-by: Name
" > > 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 "-by:" lines > + in the patch header except for Signed-off-by. 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 " > 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.