threads / patch / 38732

patchsend-email: Add CCs from additional commit tags

Subject: [PATCH] send-email: Add CCs from additional commit tags

## tl;dr

2 messages between Mar 6, 2015 and Mar 10, 2015. Diffs are folded; open one to read it.

replies: 1people: 2as markdown or json

Soren Brinkmann· Mar 6, 2015, 21:59 UTC · lore
Add email addresses from additional commonly used tags to the CC-list of
patches. Additional tags are:
 - Acked-by
 - Reviewed-by
 - Tested-by
 - Reported-by
 - Reviewed-and-tested-by
--suppress-cc=ack suppresses these additional CCs.
Signed-off-by: Soren Brinkmann <soren.brinkmann@xilinx.com>
---
 Documentation/git-send-email.txt | 3 +++
 git-send-email.perl              | 5 +++--
 2 files changed, 6 insertions(+), 2 deletions(-)
Show changes to 2 files +6 −2

Documentation/git-send-email.txt, git-send-email.perl

diff --git a/Documentation/git-send-email.txt b/Documentation/git-send-email.txt
index f248a8665e1f..1b521446ca11 100644
--- a/Documentation/git-send-email.txt
+++ b/Documentation/git-send-email.txt
@@ -293,6 +293,9 @@ 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).
+- 'ack' will avoid including anyone who acked the  patch (mentioned in
+  Acked-by, Reviewed-by, Tested-by, Reviewed-and-tested-by lines except for
+  self (use 'self' for that).
 - 'cccmd' will avoid running the --cc-cmd.
 - 'body' is equivalent to 'sob' + 'bodycc'
 - 'all' will suppress all auto cc values.
diff --git a/git-send-email.perl b/git-send-email.perl
index 3092ab356c76..18eb8a5139a4 100755
--- a/git-send-email.perl
+++ b/git-send-email.perl
@@ -407,7 +407,7 @@ my(%suppress_cc);
 if (@suppress_cc) {
 	foreach my $entry (@suppress_cc) {
 		die "Unknown --suppress-cc field: '$entry'\n"
-			unless $entry =~ /^(?:all|cccmd|cc|author|self|sob|body|bodycc)$/;
+			unless $entry =~ /^(?:all|cccmd|cc|author|self|sob|body|bodycc|ack)$/;
 		$suppress_cc{$entry} = 1;
 	}
 }
@@ -1452,7 +1452,7 @@ foreach my $t (@files) {
 	# Now parse the message body
 	while(<$fh>) {
 		$message .=  $_;
-		if (/^(Signed-off-by|Cc): (.*)$/i) {
+		if (/^(Signed-off-by|Cc|Acked-by|Reviewed-by|Tested-by|Reported-by|Reviewed-and-tested-by): (.*)$/i) {
 			chomp;
 			my ($what, $c) = ($1, $2);
 			chomp $c;
@@ -1462,6 +1462,7 @@ 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{'ack'} and $what =~ /(Acked-by|Reviewed-by|Tested-by|Reported-by|Reviewed-and-tested-by)/i;
 			}
 			push @cc, $c;
 			printf("(body) Adding cc: %s from line '%s'\n",
-- 
2.3.1.2.g90df61e.dirty
Eric Sunshine· Mar 10, 2015, 23:00 UTC · re: Soren Brinkmann · lore

Re: [PATCH] send-email: Add CCs from additional commit tags

On Fri, Mar 6, 2015 at 4:59 PM, Soren Brinkmann <soren.brinkmann@xilinx.com> wrote:

Show 9 quoted lines
> Add email addresses from additional commonly used tags to the CC-list of
> patches. Additional tags are:
>  - Acked-by
>  - Reviewed-by
>  - Tested-by
>  - Reported-by
>  - Reviewed-and-tested-by
>
> --suppress-cc=ack suppresses these additional CCs.

This and similar suggestions have come up a number of times. Rather than hard-coding an ever-growing list of tags, general consensus seems to be that it would be better to provide some sort of mechanism for people to customize the list for their needs. See, for instance, [1]. Such ability would also be a better fit for non-standard, potentially contested tags, such as Reviewed-and-tested-by:.

[1]: http://thread.gmane.org/gmane.comp.version-control.git/233003/focus=233739
Show 52 quoted lines
> Signed-off-by: Soren Brinkmann <soren.brinkmann@xilinx.com>
> ---
>  Documentation/git-send-email.txt | 3 +++
>  git-send-email.perl              | 5 +++--
>  2 files changed, 6 insertions(+), 2 deletions(-)
>
> diff --git a/Documentation/git-send-email.txt b/Documentation/git-send-email.txt
> index f248a8665e1f..1b521446ca11 100644
> --- a/Documentation/git-send-email.txt
> +++ b/Documentation/git-send-email.txt
> @@ -293,6 +293,9 @@ 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).
> +- 'ack' will avoid including anyone who acked the  patch (mentioned in
> +  Acked-by, Reviewed-by, Tested-by, Reviewed-and-tested-by lines except for
> +  self (use 'self' for that).
>  - 'cccmd' will avoid running the --cc-cmd.
>  - 'body' is equivalent to 'sob' + 'bodycc'
>  - 'all' will suppress all auto cc values.
> diff --git a/git-send-email.perl b/git-send-email.perl
> index 3092ab356c76..18eb8a5139a4 100755
> --- a/git-send-email.perl
> +++ b/git-send-email.perl
> @@ -407,7 +407,7 @@ my(%suppress_cc);
>  if (@suppress_cc) {
>         foreach my $entry (@suppress_cc) {
>                 die "Unknown --suppress-cc field: '$entry'\n"
> -                       unless $entry =~ /^(?:all|cccmd|cc|author|self|sob|body|bodycc)$/;
> +                       unless $entry =~ /^(?:all|cccmd|cc|author|self|sob|body|bodycc|ack)$/;
>                 $suppress_cc{$entry} = 1;
>         }
>  }
> @@ -1452,7 +1452,7 @@ foreach my $t (@files) {
>         # Now parse the message body
>         while(<$fh>) {
>                 $message .=  $_;
> -               if (/^(Signed-off-by|Cc): (.*)$/i) {
> +               if (/^(Signed-off-by|Cc|Acked-by|Reviewed-by|Tested-by|Reported-by|Reviewed-and-tested-by): (.*)$/i) {
>                         chomp;
>                         my ($what, $c) = ($1, $2);
>                         chomp $c;
> @@ -1462,6 +1462,7 @@ 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{'ack'} and $what =~ /(Acked-by|Reviewed-by|Tested-by|Reported-by|Reviewed-and-tested-by)/i;
>                         }
>                         push @cc, $c;
>                         printf("(body) Adding cc: %s from line '%s'\n",
> --
> 2.3.1.2.g90df61e.dirty

← back to recent threads