git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* [PATCH] git-send-email: Add auto-cc to all body signatures
@ 2011-07-29  1:34 Joe Perches
  2011-07-29  1:43 ` Jeff Kirsher
  0 siblings, 1 reply; 10+ messages in thread
From: Joe Perches @ 2011-07-29  1:34 UTC (permalink / raw)
  To: git; +Cc: Jeff Kirsher

Many types of signatures are used by various projects.

The most common type is formatted:
	"[some_signature_type]-by: First Last <email@domain.tld>"
e.g:
	"Reported-by: First Last <email@domain.tld>" (no quotes are used)

Make git-send-email use these signatures as "CC:" entries.

Add command line option --suppress-cc=signatures to avoid
adding these entries to the cc.

Signed-off-by: Joe Perches <joe@perches.com>
---
 Documentation/git-send-email.txt |    3 ++-
 git-send-email.perl              |   11 ++++++-----
 2 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/Documentation/git-send-email.txt b/Documentation/git-send-email.txt
index 327233c..17ea825 100644
--- a/Documentation/git-send-email.txt
+++ b/Documentation/git-send-email.txt
@@ -246,8 +246,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).
+- 'signatures' will avoid including anyone mentioned in any "<foo>-by:" lines.
 - 'cccmd' will avoid running the --cc-cmd.
-- 'body' is equivalent to 'sob' + 'bodycc'
+- 'body' is equivalent to 'sob' + 'bodycc + signatures'
 - 'all' will suppress all auto cc values.
 --
 +
diff --git a/git-send-email.perl b/git-send-email.perl
index 98ab33a..973ed65 100755
--- a/git-send-email.perl
+++ b/git-send-email.perl
@@ -75,7 +75,7 @@ git send-email [options] <file | directory | rev-list options >
     --identity              <str>  * Use the sendemail.<id> options.
     --to-cmd                <str>  * Email To: via `<str> \$patch_path`
     --cc-cmd                <str>  * Email Cc: via `<str> \$patch_path`
-    --suppress-cc           <str>  * author, self, sob, cc, cccmd, body, bodycc, all.
+    --suppress-cc           <str>  * author, self, sob, cc, cccmd, body, bodycc, signatures, all.
     --[no-]signed-off-by-cc        * Send to Signed-off-by: addresses. Default on.
     --[no-]suppress-from           * Send to self. Default off.
     --[no-]chain-reply-to          * Chain In-Reply-To: fields. Default off.
@@ -374,13 +374,13 @@ 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|signatures)$/;
 		$suppress_cc{$entry} = 1;
 	}
 }
 
 if ($suppress_cc{'all'}) {
-	foreach my $entry (qw (cccmd cc author self sob body bodycc)) {
+	foreach my $entry (qw (cccmd cc author self sob body bodycc signatures)) {
 		$suppress_cc{$entry} = 1;
 	}
 	delete $suppress_cc{'all'};
@@ -391,7 +391,7 @@ $suppress_cc{'self'} = $suppress_from if defined $suppress_from;
 $suppress_cc{'sob'} = !$signed_off_by_cc if defined $signed_off_by_cc;
 
 if ($suppress_cc{'body'}) {
-	foreach my $entry (qw (sob bodycc)) {
+	foreach my $entry (qw (sob bodycc signatures)) {
 		$suppress_cc{$entry} = 1;
 	}
 	delete $suppress_cc{'body'};
@@ -1251,7 +1251,7 @@ foreach my $t (@files) {
 	# Now parse the message body
 	while(<$fh>) {
 		$message .=  $_;
-		if (/^(Signed-off-by|Cc): (.*)$/i) {
+		if (/^(Signed-off-by|Cc|[a-z_-]+by): (.*)$/i) {
 			chomp;
 			my ($what, $c) = ($1, $2);
 			chomp $c;
@@ -1260,6 +1260,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{'signatures'} and $what =~ /by$/i;
 			}
 			push @cc, $c;
 			printf("(body) Adding cc: %s from line '%s'\n",
-- 
1.7.6.131.g99019

^ permalink raw reply related	[flat|nested] 10+ messages in thread

* Re: [PATCH] git-send-email: Add auto-cc to all body signatures
  2011-07-29  1:34 [PATCH] git-send-email: Add auto-cc to all body signatures Joe Perches
@ 2011-07-29  1:43 ` Jeff Kirsher
  2011-12-08  2:58   ` Joe Perches
  0 siblings, 1 reply; 10+ messages in thread
From: Jeff Kirsher @ 2011-07-29  1:43 UTC (permalink / raw)
  To: Joe Perches; +Cc: git@vger.kernel.org

[-- Attachment #1: Type: text/plain, Size: 764 bytes --]

On Thu, 2011-07-28 at 18:34 -0700, Joe Perches wrote:
> Many types of signatures are used by various projects.
> 
> The most common type is formatted:
>         "[some_signature_type]-by: First Last <email@domain.tld>"
> e.g:
>         "Reported-by: First Last <email@domain.tld>" (no quotes are
> used)
> 
> Make git-send-email use these signatures as "CC:" entries.
> 
> Add command line option --suppress-cc=signatures to avoid
> adding these entries to the cc.
> 
> Signed-off-by: Joe Perches <joe@perches.com> 

Acked-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>

Thanks, I was getting tired of having to add CC: <blah> especially since
we already had Reported-by: <blah> and Tested-by: <blah>, yet they were
never copied on the patch.

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 490 bytes --]

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [PATCH] git-send-email: Add auto-cc to all body signatures
  2011-07-29  1:43 ` Jeff Kirsher
@ 2011-12-08  2:58   ` Joe Perches
  2011-12-08 19:37     ` Junio C Hamano
  0 siblings, 1 reply; 10+ messages in thread
From: Joe Perches @ 2011-12-08  2:58 UTC (permalink / raw)
  To: git; +Cc: jeffrey.t.kirsher

Many types of signatures are used by various projects.

The most common type is formatted:
	"[some_signature_type]-by: First Last <email@domain.tld>"
e.g:
	"Reported-by: First Last <email@domain.tld>" (no quotes are used)

Make git-send-email use these signatures as "CC:" entries.

Add command line option --suppress-cc=signatures to avoid
adding these entries to the cc.

Signed-off-by: Joe Perches <joe@perches.com>
Acked-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
 Documentation/git-send-email.txt |    3 ++-
 git-send-email.perl              |   11 ++++++-----
 2 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/Documentation/git-send-email.txt b/Documentation/git-send-email.txt
index 327233c..17ea825 100644
--- a/Documentation/git-send-email.txt
+++ b/Documentation/git-send-email.txt
@@ -246,8 +246,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).
+- 'signatures' will avoid including anyone mentioned in any "<foo>-by:" lines.
 - 'cccmd' will avoid running the --cc-cmd.
-- 'body' is equivalent to 'sob' + 'bodycc'
+- 'body' is equivalent to 'sob' + 'bodycc + signatures'
 - 'all' will suppress all auto cc values.
 --
 +
diff --git a/git-send-email.perl b/git-send-email.perl
index d491db9..fc5bf41 100755
--- a/git-send-email.perl
+++ b/git-send-email.perl
@@ -75,7 +75,7 @@ git send-email [options] <file | directory | rev-list options >
     --identity              <str>  * Use the sendemail.<id> options.
     --to-cmd                <str>  * Email To: via `<str> \$patch_path`
     --cc-cmd                <str>  * Email Cc: via `<str> \$patch_path`
-    --suppress-cc           <str>  * author, self, sob, cc, cccmd, body, bodycc, all.
+    --suppress-cc           <str>  * author, self, sob, cc, cccmd, body, bodycc, signatures, all.
     --[no-]signed-off-by-cc        * Send to Signed-off-by: addresses. Default on.
     --[no-]suppress-from           * Send to self. Default off.
     --[no-]chain-reply-to          * Chain In-Reply-To: fields. Default off.
@@ -393,13 +393,13 @@ 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|signatures)$/;
 		$suppress_cc{$entry} = 1;
 	}
 }
 
 if ($suppress_cc{'all'}) {
-	foreach my $entry (qw (cccmd cc author self sob body bodycc)) {
+	foreach my $entry (qw (cccmd cc author self sob body bodycc signatures)) {
 		$suppress_cc{$entry} = 1;
 	}
 	delete $suppress_cc{'all'};
@@ -410,7 +410,7 @@ $suppress_cc{'self'} = $suppress_from if defined $suppress_from;
 $suppress_cc{'sob'} = !$signed_off_by_cc if defined $signed_off_by_cc;
 
 if ($suppress_cc{'body'}) {
-	foreach my $entry (qw (sob bodycc)) {
+	foreach my $entry (qw (sob bodycc signatures)) {
 		$suppress_cc{$entry} = 1;
 	}
 	delete $suppress_cc{'body'};
@@ -1276,7 +1276,7 @@ foreach my $t (@files) {
 	# Now parse the message body
 	while(<$fh>) {
 		$message .=  $_;
-		if (/^(Signed-off-by|Cc): (.*)$/i) {
+		if (/^(Signed-off-by|Cc|[a-z_-]+by): (.*)$/i) {
 			chomp;
 			my ($what, $c) = ($1, $2);
 			chomp $c;
@@ -1285,6 +1285,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{'signatures'} and $what =~ /by$/i;
 			}
 			push @cc, $c;
 			printf("(body) Adding cc: %s from line '%s'\n",
-- 
1.7.8.dirty

^ permalink raw reply related	[flat|nested] 10+ messages in thread

* Re: [PATCH] git-send-email: Add auto-cc to all body signatures
  2011-12-08  2:58   ` Joe Perches
@ 2011-12-08 19:37     ` Junio C Hamano
  2011-12-08 20:51       ` Joe Perches
  0 siblings, 1 reply; 10+ messages in thread
From: Junio C Hamano @ 2011-12-08 19:37 UTC (permalink / raw)
  To: Joe Perches; +Cc: git, jeffrey.t.kirsher

Joe Perches <joe@perches.com> writes:

> Many types of signatures are used by various projects.
>
> The most common type is formatted:
> 	"[some_signature_type]-by: First Last <email@domain.tld>"
> e.g:
> 	"Reported-by: First Last <email@domain.tld>" (no quotes are used)

This is just a phrasing issue, but I am a bit reluctant about the name
"signature". "Acked-by:", "Tested-by:" and "Reviewed-by:" are originally
written in the message sent to the author by the person who is giving an
Ack, a successful test report, and a review comment, and the author (at
least in spirit) copies & pastes them to the final text used in the commit
log message, so it would not be incorrect to call them "signatures". But
other "Random-by:" would not fall into that pattern.

"Reported-by:" certainly does not.  It is almost always added by the
author of the patch that is different from the reporter, and the reporter
wouldn't have written "Reported-by: me" in the original bug report that
triggered the discussion and resulted in the commit to fix the bug. Such a
line is certainly not a signature of/by the reporter. Same can be said for
"Helped-by:" for the author to share credits.

Also I've seen these "Random-by:", especially the ones that the author
adds on his own initiative like "Reported-by:", followed by just a name
but not an addresses [*1*].

Does your change do the right thing on such an address-less entry?  The
answer to this question must start with the definition of "the right thing
to do is X", of course.

> diff --git a/Documentation/git-send-email.txt b/Documentation/git-send-email.txt
> index 327233c..17ea825 100644
> --- a/Documentation/git-send-email.txt
> +++ b/Documentation/git-send-email.txt
> @@ -246,8 +246,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).
> +- 'signatures' will avoid including anyone mentioned in any "<foo>-by:" lines.
>  - 'cccmd' will avoid running the --cc-cmd.
> -- 'body' is equivalent to 'sob' + 'bodycc'
> +- 'body' is equivalent to 'sob' + 'bodycc + signatures'

The quotes do not match quite well.


[Footnote]

*1* This seems to be done deliberately so; I understand that this is to
avoid running afoul of EU privacy legislation or something.

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] git-send-email: Add auto-cc to all body signatures
  2011-12-08 19:37     ` Junio C Hamano
@ 2011-12-08 20:51       ` Joe Perches
  2015-12-02 10:04         ` Rasmus Villemoes
  0 siblings, 1 reply; 10+ messages in thread
From: Joe Perches @ 2011-12-08 20:51 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git, jeffrey.t.kirsher

On Thu, 2011-12-08 at 11:37 -0800, Junio C Hamano wrote:
> Joe Perches <joe@perches.com> writes:
> > Many types of signatures are used by various projects.
> > The most common type is formatted:
> > 	"[some_signature_type]-by: First Last <email@domain.tld>"
> > e.g:
> > 	"Reported-by: First Last <email@domain.tld>" (no quotes are used)
> This is just a phrasing issue, but I am a bit reluctant about the name
> "signature".

I've called all these markings signatures.
Maybe email-address-tags or another name could be used.
I'm not bothered one way or another by any chosen name.

> Does your change do the right thing on such an address-less entry?  The
> answer to this question must start with the definition of "the right thing
> to do is X", of course.

All addresses go through "extract_valid_address".
Invalid addresses are not used.

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] git-send-email: Add auto-cc to all body signatures
  2011-12-08 20:51       ` Joe Perches
@ 2015-12-02 10:04         ` Rasmus Villemoes
  2015-12-02 17:00           ` [PATCH V3] " Joe Perches
  0 siblings, 1 reply; 10+ messages in thread
From: Rasmus Villemoes @ 2015-12-02 10:04 UTC (permalink / raw)
  To: Joe Perches; +Cc: Junio C Hamano, git, jeffrey.t.kirsher

On Thu, Dec 08 2011, Joe Perches <joe@perches.com> wrote:

> On Thu, 2011-12-08 at 11:37 -0800, Junio C Hamano wrote:
>> Joe Perches <joe@perches.com> writes:
>> > Many types of signatures are used by various projects.
>> > The most common type is formatted:
>> > 	"[some_signature_type]-by: First Last <email@domain.tld>"
>> > e.g:
>> > 	"Reported-by: First Last <email@domain.tld>" (no quotes are used)
>> This is just a phrasing issue, but I am a bit reluctant about the name
>> "signature".
>
> I've called all these markings signatures.
> Maybe email-address-tags or another name could be used.
> I'm not bothered one way or another by any chosen name.

It's been four years, but I recently ran into this. I mistakenly thought
that git would actually pick up cc addresses also from Reported-by, so
the reporter ended up not being cc'ed. Is there any chance this could be
revisited, or should I use a --cc-cmd to do what I want?

Rasmus

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [PATCH V3] git-send-email: Add auto-cc to all body signatures
  2015-12-02 10:04         ` Rasmus Villemoes
@ 2015-12-02 17:00           ` Joe Perches
  2015-12-02 17:58             ` Junio C Hamano
  0 siblings, 1 reply; 10+ messages in thread
From: Joe Perches @ 2015-12-02 17:00 UTC (permalink / raw)
  To: Rasmus Villemoes; +Cc: Junio C Hamano, git, jeffrey.t.kirsher

Many types of signatures are used by various projects.

The most common type is formatted:
	"[some_signature_type]-by: First Last <email <at> domain.tld>"
e.g:
	"Reported-by: First Last <email <at> domain.tld>" (no quotes are used)

Make git-send-email use these signatures as "CC:" entries.

Add command line option --suppress-cc=signatures to avoid
adding these entries to the cc.

Signed-off-by: Joe Perches <joe <at> perches.com>
Acked-by: Jeff Kirsher <jeffrey.t.kirsher <at> intel.com>
---
> It's been four years, but I recently ran into this. I mistakenly thought
> that git would actually pick up cc addresses also from Reported-by, so
> the reporter ended up not being cc'ed. Is there any chance this could be
> revisited,

Here's a refresh if desired.  I still think it's sensible.

 Documentation/git-send-email.txt |  3 ++-
 git-send-email.perl              | 11 ++++++-----
 2 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/Documentation/git-send-email.txt b/Documentation/git-send-email.txt
index b9134d2..0866ae2 100644
--- a/Documentation/git-send-email.txt
+++ b/Documentation/git-send-email.txt
@@ -306,8 +306,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).
+- 'signatures' will avoid including anyone mentioned in any "<foo>-by:" lines.
 - 'cccmd' will avoid running the --cc-cmd.
-- 'body' is equivalent to 'sob' + 'bodycc'
+- 'body' is equivalent to 'sob' + 'bodycc' + 'signatures'
 - 'all' will suppress all auto cc values.
 --
 +
diff --git a/git-send-email.perl b/git-send-email.perl
index e907e0ea..536e264 100755
--- a/git-send-email.perl
+++ b/git-send-email.perl
@@ -83,7 +83,7 @@ git send-email [options] <file | directory | rev-list options >
     --identity              <str>  * Use the sendemail.<id> options.
     --to-cmd                <str>  * Email To: via `<str> \$patch_path`
     --cc-cmd                <str>  * Email Cc: via `<str> \$patch_path`
-    --suppress-cc           <str>  * author, self, sob, cc, cccmd, body, bodycc, all.
+    --suppress-cc           <str>  * author, self, sob, cc, cccmd, body, bodycc, signatures, all.
     --[no-]cc-cover                * Email Cc: addresses in the cover letter.
     --[no-]to-cover                * Email To: addresses in the cover letter.
     --[no-]signed-off-by-cc        * Send to Signed-off-by: addresses. Default on.
@@ -421,13 +421,13 @@ 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|signatures)$/;
 		$suppress_cc{$entry} = 1;
 	}
 }
 
 if ($suppress_cc{'all'}) {
-	foreach my $entry (qw (cccmd cc author self sob body bodycc)) {
+	foreach my $entry (qw (cccmd cc author self sob body bodycc signatures)) {
 		$suppress_cc{$entry} = 1;
 	}
 	delete $suppress_cc{'all'};
@@ -438,7 +438,7 @@ $suppress_cc{'self'} = $suppress_from if defined $suppress_from;
 $suppress_cc{'sob'} = !$signed_off_by_cc if defined $signed_off_by_cc;
 
 if ($suppress_cc{'body'}) {
-	foreach my $entry (qw (sob bodycc)) {
+	foreach my $entry (qw (sob bodycc signatures)) {
 		$suppress_cc{$entry} = 1;
 	}
 	delete $suppress_cc{'body'};
@@ -1516,7 +1516,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]+[_-]by): (.*)$/i) {
 			chomp;
 			my ($what, $c) = ($1, $2);
 			chomp $c;
@@ -1526,6 +1526,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{'signatures'} and $what =~ /by$/i;
 			}
 			push @cc, $c;
 			printf("(body) Adding cc: %s from line '%s'\n",

^ permalink raw reply related	[flat|nested] 10+ messages in thread

* Re: [PATCH V3] git-send-email: Add auto-cc to all body signatures
  2015-12-02 17:00           ` [PATCH V3] " Joe Perches
@ 2015-12-02 17:58             ` Junio C Hamano
  2015-12-02 18:20               ` Joe Perches
  2015-12-02 18:28               ` Joe Perches
  0 siblings, 2 replies; 10+ messages in thread
From: Junio C Hamano @ 2015-12-02 17:58 UTC (permalink / raw)
  To: Joe Perches; +Cc: Rasmus Villemoes, git, jeffrey.t.kirsher

Joe Perches <joe@perches.com> writes:

> Many types of signatures are used by various projects.
>
> The most common type is formatted:
> 	"[some_signature_type]-by: First Last <email <at> domain.tld>"
> e.g:
> 	"Reported-by: First Last <email <at> domain.tld>" (no quotes are used)
>
> Make git-send-email use these signatures as "CC:" entries.
>
> Add command line option --suppress-cc=signatures to avoid
> adding these entries to the cc.
>
> Signed-off-by: Joe Perches <joe <at> perches.com>
> Acked-by: Jeff Kirsher <jeffrey.t.kirsher <at> intel.com>

I wonder what send-email with this patch does to the above two lines
with "<at>" not "@" ;-)  How was this patch sent?

In any case, did you mean "Helped-by:" not "Acked-by:"?  "git
shortlog git-send-email.perl" does not show that name as one of the
major stakeholders who would be capable of giving an Ack on it.

> ---
>> It's been four years, but I recently ran into this. I mistakenly thought
>> that git would actually pick up cc addresses also from Reported-by, so
>> the reporter ended up not being cc'ed. Is there any chance this could be
>> revisited,
>
> Here's a refresh if desired.  I still think it's sensible.

What the patch tries to achieve may make a lot of sense.  I however
do not necessarily think this particular implementation does,
unfortunately.

These "Random-by:", especially the ones that the author adds on his
own initiative like "Reported-by:", are often followed by just a
name but not an addresses.  A "Signed-off-by:" and "Cc:" that is not
followed by a valid e-mail address may deserve to get an error (or
perhaps an end-user interaction "This is not a valid address. What
do you want to do about it?") so "/^(Signed-off-by|Cc): (.*)$/i"
does not need its own sanity check on $2, because a later call to
extract-valid-address or extract-valid-address-or-die will take care
of it.

It would however be wrong to cause the program to error out or even
bother the user upon seeing such random trailer lines that the
author did not mean to have an e-mail address on it in the first
place.  If you have a trailer line

    Random-by: Joe Perches

without an address, I suspect you will end up adding "Joe" and
"Perches" as two addresses on the Cc: line, which is most likely not
what the user intended [*1*].

As to the lingo, these are still not signatures, but during the past
years, it seems that we settled on using the term "trailers" for
these e-mail header-like things at the end of the log message.
"Trailers" are not limited to "*-by:" so this patch is not about
adding auto-cc to all trailers--a retitle would be

    send-email: add auto-cc to addresses that appear on *-by: trailers

or something (and the option and variable names may need to be
updated to match).


[Footnote]

*1* I further suspect that the existing code shares a similar issue.
Don't Cc: and Signed-off-by: expect a single address on each line in
the usual fashion?  Perhaps a two-patch series whose first part does

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

to tighten it (so that "Cc: Joe Perches" would not result in two
pieces of mail sent to Joe and Perches), with your patch as a follow
up, may be a good way forward.

I dunno.

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH V3] git-send-email: Add auto-cc to all body signatures
  2015-12-02 17:58             ` Junio C Hamano
@ 2015-12-02 18:20               ` Joe Perches
  2015-12-02 18:28               ` Joe Perches
  1 sibling, 0 replies; 10+ messages in thread
From: Joe Perches @ 2015-12-02 18:20 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: Rasmus Villemoes, git, jeffrey.t.kirsher

On Wed, 2015-12-02 at 09:58 -0800, Junio C Hamano wrote:
> Joe Perches <joe@perches.com> writes:
> 
> > Many types of signatures are used by various projects.
> > 
> > The most common type is formatted:
> > 	"[some_signature_type]-by: First Last <email <at> domain.tld>"
> > e.g:
> > 	"Reported-by: First Last <email <at> domain.tld>" (no quotes are used)
> > 
> > Make git-send-email use these signatures as "CC:" entries.
> > 
> > Add command line option --suppress-cc=signatures to avoid
> > adding these entries to the cc.
> > 
> > Signed-off-by: Joe Perches  perches.com>
> > Acked-by: Jeff Kirsher  intel.com>
> 
> I wonder what send-email with this patch does to the above two lines
> with "" not "@" ;-)  How was this patch sent?

gnome evolution v3.18.2 email client.

And it seems all newer versions of evolution beyond 3.12
are really, really poor at sending inline patches. <grumble>

I'll update and resend using git-send-email eventually

> In any case, did you mean "Helped-by:" not "Acked-by:"?  "git
> shortlog git-send-email.perl" does not show that name as one of the
> major stakeholders who would be capable of giving an Ack on it.

At least for linux-kernel, "Acked-by:" doesn't mean a maintainer
or a contributor to a particular module/file, just someone that
has looked at the patch, tried it, and approved of the concept.

I don't know what process git uses for approval/signatures.

> > ---
> > > It's been four years, but I recently ran into this. I mistakenly thought
> > > that git would actually pick up cc addresses also from Reported-by, so
> > > the reporter ended up not being cc'ed. Is there any chance this could be
> > > revisited,
> > 
> > Here's a refresh if desired.  I still think it's sensible.
> 
> What the patch tries to achieve may make a lot of sense.  I however
> do not necessarily think this particular implementation does,
> unfortunately.
> 
> These "Random-by:", especially the ones that the author adds on his
> own initiative like "Reported-by:", are often followed by just a
> name but not an addresses.  A "Signed-off-by:" and "Cc:" that is not
> followed by a valid e-mail address may deserve to get an error (or
> perhaps an end-user interaction "This is not a valid address. What
> do you want to do about it?") so "/^(Signed-off-by|Cc): (.*)$/i"
> does not need its own sanity check on $2, because a later call to
> extract-valid-address or extract-valid-address-or-die will take care
> of it.

> It would however be wrong to cause the program to error out or even
> bother the user upon seeing such random trailer lines that the
> author did not mean to have an e-mail address on it in the first
> place.  If you have a trailer line
> 
>     Random-by: Joe Perches
> 
> without an address, I suspect you will end up adding "Joe" and
> "Perches" as two addresses on the Cc: line, which is most likely not
> what the user intended [*1*].

At least with new versions of git-send-email.perl
that's true so the patch will need to validate that
there is an email address following.

> As to the lingo, these are still not signatures, but during the past
> years, it seems that we settled on using the term "trailers" for
> these e-mail header-like things at the end of the log message.
> "Trailers" are not limited to "*-by:" so this patch is not about
> adding auto-cc to all trailers--a retitle would be
> 
>     send-email: add auto-cc to addresses that appear on *-by: trailers
> 
> or something (and the option and variable names may need to be
> updated to match).
> 
> 
> [Footnote]
> 
> *1* I further suspect that the existing code shares a similar issue.
> Don't Cc: and Signed-off-by: expect a single address on each line in
> the usual fashion?  Perhaps a two-patch series whose first part does
> 
> -		if (/^(Signed-off-by|Cc): (.*)$/i) {
> +		if (/^(Signed-off-by|Cc): (.*<[^>]*>)\s*$/i) {
> 
> to tighten it (so that "Cc: Joe Perches" would not result in two
> pieces of mail sent to Joe and Perches), with your patch as a follow
> up, may be a good way forward.
> 
> I dunno.

I believe the old git-send-email code required addresses
and validated the form after Signed-off-by:'s.

I haven't looked at the code for several years and just
refreshed it without much thinking or testing.

I'll do a bit more and resend.

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH V3] git-send-email: Add auto-cc to all body signatures
  2015-12-02 17:58             ` Junio C Hamano
  2015-12-02 18:20               ` Joe Perches
@ 2015-12-02 18:28               ` Joe Perches
  1 sibling, 0 replies; 10+ messages in thread
From: Joe Perches @ 2015-12-02 18:28 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: Rasmus Villemoes, git, jeffrey.t.kirsher

On Wed, 2015-12-02 at 09:58 -0800, Junio C Hamano wrote:
> "Trailers" are not limited to "*-by:"

btw:  what are "Trailers" limited by?

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2015-12-02 18:29 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-07-29  1:34 [PATCH] git-send-email: Add auto-cc to all body signatures Joe Perches
2011-07-29  1:43 ` Jeff Kirsher
2011-12-08  2:58   ` Joe Perches
2011-12-08 19:37     ` Junio C Hamano
2011-12-08 20:51       ` Joe Perches
2015-12-02 10:04         ` Rasmus Villemoes
2015-12-02 17:00           ` [PATCH V3] " Joe Perches
2015-12-02 17:58             ` Junio C Hamano
2015-12-02 18:20               ` Joe Perches
2015-12-02 18:28               ` Joe Perches

Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).