From: Rasmus Villemoes Date: Thu, 11 Oct 2018 07:11:42 GMT Subject: Re: [PATCH 3/3] send-email: also pick up cc addresses from -by trailers Message-ID: <5651069a-4879-096d-082d-58d8f0158958@rasmusvillemoes.dk> In-Reply-To: On 2018-10-11 08:18, Junio C Hamano wrote: > Rasmus Villemoes writes: > we now ... > >> + next if $suppress_cc{'sob'} and $what =~ /^Signed-off-by$/i; > > ... must make sure what we have is _exactly_ "signed-off-by" when > 'sob' is suppressed. Makes sense. > >> + next if $suppress_cc{'misc-by'} >> + and $what =~ /-by$/i and $what !~ /^Signed-off-by$/i; > > And this is the opposite side of the same coin, which also makes sense. Yup, I started by just adding the misc-by line, then remembered that people sometimes use not-signed-off-by variants, and went back and anchored the s-o-b case. So now it's no longer so minimal, and... > I wonder if it would make it easier to grok if we made the logic > inside out, i.e. > > if ($sc eq $sender) { > ... > } else { > if ($what =~ /^Signed-off-by$/i) { > next if $suppress_cc{'sob'}; > } elsif ($what =~ /-by$/i) { > next if $suppress_cc{'misc'}; > } elsif ($what =~ /^Cc$/i) { > next if $suppress_cc{'bodycc'};> } ...yes, that's probably more readable. Thanks, Rasmus