git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RFC][PATCH] send-email: add --[no-]xmailer option
@ 2014-03-24 21:38 Luis Henriques
  2014-12-02 19:32 ` Luis Henriques
  2014-12-03 17:08 ` Junio C Hamano
  0 siblings, 2 replies; 13+ messages in thread
From: Luis Henriques @ 2014-03-24 21:38 UTC (permalink / raw)
  To: git

Add --[no-]xmailer that allows a user to disable adding the 'X-Mailer:'
header to the email being sent.

Signed-off-by: Luis Henriques <henrix@camandro.org>
---
 Documentation/config.txt         |  1 +
 Documentation/git-send-email.txt |  3 +++
 git-send-email.perl              | 12 ++++++++++--
 3 files changed, 14 insertions(+), 2 deletions(-)

diff --git a/Documentation/config.txt b/Documentation/config.txt
index 73c8973..c33d5a1 100644
--- a/Documentation/config.txt
+++ b/Documentation/config.txt
@@ -2222,6 +2222,7 @@ sendemail.smtpserveroption::
 sendemail.smtpuser::
 sendemail.thread::
 sendemail.validate::
+sendemail.xmailer::
 	See linkgit:git-send-email[1] for description.
 
 sendemail.signedoffcc::
diff --git a/Documentation/git-send-email.txt b/Documentation/git-send-email.txt
index f0e57a5..fab6264 100644
--- a/Documentation/git-send-email.txt
+++ b/Documentation/git-send-email.txt
@@ -131,6 +131,9 @@ Note that no attempts whatsoever are made to validate the encoding.
 	Specify encoding of compose message. Default is the value of the
 	'sendemail.composeencoding'; if that is unspecified, UTF-8 is assumed.
 
+--xmailer::
+	Prevent adding the "X-Mailer:" header.  Default value is
+	'sendemail.xmailer'.
 
 Sending
 ~~~~~~~
diff --git a/git-send-email.perl b/git-send-email.perl
index fdb0029..8789124 100755
--- a/git-send-email.perl
+++ b/git-send-email.perl
@@ -54,6 +54,7 @@ git send-email [options] <file | directory | rev-list options >
     --[no-]bcc              <str>  * Email Bcc:
     --subject               <str>  * Email "Subject:"
     --in-reply-to           <str>  * Email "In-Reply-To:"
+    --[no-]xmailer                 * Don't add "X-Mailer:" header.  Default on.
     --[no-]annotate                * Review each patch that will be sent in an editor.
     --compose                      * Open an editor for introduction.
     --compose-encoding      <str>  * Encoding to assume for introduction.
@@ -174,6 +175,9 @@ my $force = 0;
 my $multiedit;
 my $editor;
 
+# Usage of X-Mailer email header
+my $xmailer;
+
 sub do_edit {
 	if (!defined($editor)) {
 		$editor = Git::command_oneline('var', 'GIT_EDITOR');
@@ -214,7 +218,8 @@ my %config_bool_settings = (
     "signedoffcc" => [\$signed_off_by_cc, undef],      # Deprecated
     "validate" => [\$validate, 1],
     "multiedit" => [\$multiedit, undef],
-    "annotate" => [\$annotate, undef]
+    "annotate" => [\$annotate, undef],
+    "xmailer" => [\$xmailer, 1]
 );
 
 my %config_settings = (
@@ -311,6 +316,7 @@ my $rc = GetOptions("h" => \$help,
 		    "8bit-encoding=s" => \$auto_8bit_encoding,
 		    "compose-encoding=s" => \$compose_encoding,
 		    "force" => \$force,
+		    "xmailer!" => \$xmailer,
 	 );
 
 usage() if $help;
@@ -1144,8 +1150,10 @@ To: $to${ccline}
 Subject: $subject
 Date: $date
 Message-Id: $message_id
-X-Mailer: git-send-email $gitversion
 ";
+	if ($xmailer) {
+		$header .= "X-Mailer: git-send-email $gitversion\n";
+	}
 	if ($reply_to) {
 
 		$header .= "In-Reply-To: $reply_to\n";
-- 
1.9.1

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

* Re: [RFC][PATCH] send-email: add --[no-]xmailer option
  2014-03-24 21:38 [RFC][PATCH] send-email: add --[no-]xmailer option Luis Henriques
@ 2014-12-02 19:32 ` Luis Henriques
  2014-12-03  2:34   ` Eric Wong
  2014-12-03 17:08 ` Junio C Hamano
  1 sibling, 1 reply; 13+ messages in thread
From: Luis Henriques @ 2014-12-02 19:32 UTC (permalink / raw)
  To: git

On Mon, Mar 24, 2014 at 09:38:27PM +0000, Luis Henriques wrote:
> Add --[no-]xmailer that allows a user to disable adding the 'X-Mailer:'
> header to the email being sent.
>

Ping

It's been a while since I sent this patch.  Is there any interest in
having this switch in git-send-email?

I honestly don't like disclosing too much information about my system,
in this case which MUA I'm using and its version.

Cheers,
-- 
Luís

> Signed-off-by: Luis Henriques <henrix@camandro.org>
> ---
>  Documentation/config.txt         |  1 +
>  Documentation/git-send-email.txt |  3 +++
>  git-send-email.perl              | 12 ++++++++++--
>  3 files changed, 14 insertions(+), 2 deletions(-)
> 
> diff --git a/Documentation/config.txt b/Documentation/config.txt
> index 73c8973..c33d5a1 100644
> --- a/Documentation/config.txt
> +++ b/Documentation/config.txt
> @@ -2222,6 +2222,7 @@ sendemail.smtpserveroption::
>  sendemail.smtpuser::
>  sendemail.thread::
>  sendemail.validate::
> +sendemail.xmailer::
>  	See linkgit:git-send-email[1] for description.
>  
>  sendemail.signedoffcc::
> diff --git a/Documentation/git-send-email.txt b/Documentation/git-send-email.txt
> index f0e57a5..fab6264 100644
> --- a/Documentation/git-send-email.txt
> +++ b/Documentation/git-send-email.txt
> @@ -131,6 +131,9 @@ Note that no attempts whatsoever are made to validate the encoding.
>  	Specify encoding of compose message. Default is the value of the
>  	'sendemail.composeencoding'; if that is unspecified, UTF-8 is assumed.
>  
> +--xmailer::
> +	Prevent adding the "X-Mailer:" header.  Default value is
> +	'sendemail.xmailer'.
>  
>  Sending
>  ~~~~~~~
> diff --git a/git-send-email.perl b/git-send-email.perl
> index fdb0029..8789124 100755
> --- a/git-send-email.perl
> +++ b/git-send-email.perl
> @@ -54,6 +54,7 @@ git send-email [options] <file | directory | rev-list options >
>      --[no-]bcc              <str>  * Email Bcc:
>      --subject               <str>  * Email "Subject:"
>      --in-reply-to           <str>  * Email "In-Reply-To:"
> +    --[no-]xmailer                 * Don't add "X-Mailer:" header.  Default on.
>      --[no-]annotate                * Review each patch that will be sent in an editor.
>      --compose                      * Open an editor for introduction.
>      --compose-encoding      <str>  * Encoding to assume for introduction.
> @@ -174,6 +175,9 @@ my $force = 0;
>  my $multiedit;
>  my $editor;
>  
> +# Usage of X-Mailer email header
> +my $xmailer;
> +
>  sub do_edit {
>  	if (!defined($editor)) {
>  		$editor = Git::command_oneline('var', 'GIT_EDITOR');
> @@ -214,7 +218,8 @@ my %config_bool_settings = (
>      "signedoffcc" => [\$signed_off_by_cc, undef],      # Deprecated
>      "validate" => [\$validate, 1],
>      "multiedit" => [\$multiedit, undef],
> -    "annotate" => [\$annotate, undef]
> +    "annotate" => [\$annotate, undef],
> +    "xmailer" => [\$xmailer, 1]
>  );
>  
>  my %config_settings = (
> @@ -311,6 +316,7 @@ my $rc = GetOptions("h" => \$help,
>  		    "8bit-encoding=s" => \$auto_8bit_encoding,
>  		    "compose-encoding=s" => \$compose_encoding,
>  		    "force" => \$force,
> +		    "xmailer!" => \$xmailer,
>  	 );
>  
>  usage() if $help;
> @@ -1144,8 +1150,10 @@ To: $to${ccline}
>  Subject: $subject
>  Date: $date
>  Message-Id: $message_id
> -X-Mailer: git-send-email $gitversion
>  ";
> +	if ($xmailer) {
> +		$header .= "X-Mailer: git-send-email $gitversion\n";
> +	}
>  	if ($reply_to) {
>  
>  		$header .= "In-Reply-To: $reply_to\n";
> -- 
> 1.9.1

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

* Re: [RFC][PATCH] send-email: add --[no-]xmailer option
  2014-12-02 19:32 ` Luis Henriques
@ 2014-12-03  2:34   ` Eric Wong
  2014-12-03  3:22     ` Kyle J. McKay
  2014-12-03 16:56     ` Junio C Hamano
  0 siblings, 2 replies; 13+ messages in thread
From: Eric Wong @ 2014-12-03  2:34 UTC (permalink / raw)
  To: Luis Henriques; +Cc: git

Luis Henriques <henrix@camandro.org> wrote:
> On Mon, Mar 24, 2014 at 09:38:27PM +0000, Luis Henriques wrote:
> > Add --[no-]xmailer that allows a user to disable adding the 'X-Mailer:'
> > header to the email being sent.
> >
> 
> Ping
> 
> It's been a while since I sent this patch.  Is there any interest in
> having this switch in git-send-email?

I wasn't paying attention when the original was sent, but this
looks good to me.

Acked-by: Eric Wong <normalperson@yhbt.net>

> I honestly don't like disclosing too much information about my system,
> in this case which MUA I'm using and its version.

Right on.  I would even favor this being the default.

Auto-generated Message-Id headers also shows the use of git-send-email;
perhaps there can be a way to configure that, too.  However,
git-send-email respects manually-added Message-Id headers in the
original patch, so it's less of a problem, I suppose.

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

* Re: [RFC][PATCH] send-email: add --[no-]xmailer option
  2014-12-03  2:34   ` Eric Wong
@ 2014-12-03  3:22     ` Kyle J. McKay
  2014-12-03 10:13       ` Luis Henriques
  2014-12-03 16:56     ` Junio C Hamano
  1 sibling, 1 reply; 13+ messages in thread
From: Kyle J. McKay @ 2014-12-03  3:22 UTC (permalink / raw)
  To: Eric Wong; +Cc: Luis Henriques, git

On Dec 2, 2014, at 18:34, Eric Wong wrote:

> Luis Henriques <henrix@camandro.org> wrote:
>> On Mon, Mar 24, 2014 at 09:38:27PM +0000, Luis Henriques wrote:
>>> Add --[no-]xmailer that allows a user to disable adding the 'X- 
>>> Mailer:'
>>> header to the email being sent.
>>>
>>
>> Ping
>>
>> It's been a while since I sent this patch.  Is there any interest in
>> having this switch in git-send-email?
>
> I wasn't paying attention when the original was sent, but this
> looks good to me.
>
> Acked-by: Eric Wong <normalperson@yhbt.net>
>
>> I honestly don't like disclosing too much information about my  
>> system,
>> in this case which MUA I'm using and its version.
>
> Right on.  I would even favor this being the default.

I fully agree with you.

> Auto-generated Message-Id headers also shows the use of git-send- 
> email;
> perhaps there can be a way to configure that, too.  However,
> git-send-email respects manually-added Message-Id headers in the
> original patch, so it's less of a problem, I suppose.

It can be hashed like so to avoid leaking information:

diff --git a/git-send-email.orig b/git-send-email.new
index f3d75e8..d0b4bff 100755
--- a/git-send-email.orig
+++ b/git-send-email.new
@@ -27,6 +27,7 @@ use Data::Dumper;
  use Term::ANSIColor;
  use File::Temp qw/ tempdir tempfile /;
  use File::Spec::Functions qw(catfile);
+use Digest::MD5 qw(md5_hex);
  use Error qw(:try);
  use Git;

@@ -901,8 +903,10 @@ sub make_message_id {
  		require Sys::Hostname;
  		$du_part = 'user@' . Sys::Hostname::hostname();
  	}
-	my $message_id_template = "<%s-git-send-email-%s>";
+	my $message_id_template = "%s-git-send-email-%s";
  	$message_id = sprintf($message_id_template, $uniq, $du_part);
+	@_ = split /@/, $message_id;
+	$message_id = '<'.substr(md5_hex($_[0]), 
0,31).'@'.substr(md5_hex($_[1]),1,31).'>';
  	#print "new message id = $message_id\n"; # Was useful for debugging
  }

---

--Kyle

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

* Re: [RFC][PATCH] send-email: add --[no-]xmailer option
  2014-12-03  3:22     ` Kyle J. McKay
@ 2014-12-03 10:13       ` Luis Henriques
  0 siblings, 0 replies; 13+ messages in thread
From: Luis Henriques @ 2014-12-03 10:13 UTC (permalink / raw)
  To: Kyle J. McKay; +Cc: Eric Wong, git

On Tue, Dec 02, 2014 at 07:22:10PM -0800, Kyle J. McKay wrote:
> On Dec 2, 2014, at 18:34, Eric Wong wrote:
> 
> >Luis Henriques <henrix@camandro.org> wrote:
> >>On Mon, Mar 24, 2014 at 09:38:27PM +0000, Luis Henriques wrote:
> >>>Add --[no-]xmailer that allows a user to disable adding the 'X-Mailer:'
> >>>header to the email being sent.
> >>>
> >>
> >>Ping
> >>
> >>It's been a while since I sent this patch.  Is there any interest in
> >>having this switch in git-send-email?
> >
> >I wasn't paying attention when the original was sent, but this
> >looks good to me.
> >
> >Acked-by: Eric Wong <normalperson@yhbt.net>
> >
> >>I honestly don't like disclosing too much information about my system,
> >>in this case which MUA I'm using and its version.
> >
> >Right on.  I would even favor this being the default.
> 
> I fully agree with you.
> 
> >Auto-generated Message-Id headers also shows the use of git-send-email;
> >perhaps there can be a way to configure that, too.  However,
> >git-send-email respects manually-added Message-Id headers in the
> >original patch, so it's less of a problem, I suppose.
> 
> It can be hashed like so to avoid leaking information:

Awesome, I like this idea too!

Cheers,
-- 
Luís

> 
> diff --git a/git-send-email.orig b/git-send-email.new
> index f3d75e8..d0b4bff 100755
> --- a/git-send-email.orig
> +++ b/git-send-email.new
> @@ -27,6 +27,7 @@ use Data::Dumper;
>  use Term::ANSIColor;
>  use File::Temp qw/ tempdir tempfile /;
>  use File::Spec::Functions qw(catfile);
> +use Digest::MD5 qw(md5_hex);
>  use Error qw(:try);
>  use Git;
> 
> @@ -901,8 +903,10 @@ sub make_message_id {
>  		require Sys::Hostname;
>  		$du_part = 'user@' . Sys::Hostname::hostname();
>  	}
> -	my $message_id_template = "<%s-git-send-email-%s>";
> +	my $message_id_template = "%s-git-send-email-%s";
>  	$message_id = sprintf($message_id_template, $uniq, $du_part);
> +	@_ = split /@/, $message_id;
> +	$message_id = '<'.substr(md5_hex($_[0]),0,31).'@'.substr(md5_hex($_[1]),1,31).'>';
>  	#print "new message id = $message_id\n"; # Was useful for debugging
>  }
> 
> ---
> 
> --Kyle

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

* Re: [RFC][PATCH] send-email: add --[no-]xmailer option
  2014-12-03  2:34   ` Eric Wong
  2014-12-03  3:22     ` Kyle J. McKay
@ 2014-12-03 16:56     ` Junio C Hamano
  2014-12-04 19:22       ` Luis Henriques
  1 sibling, 1 reply; 13+ messages in thread
From: Junio C Hamano @ 2014-12-03 16:56 UTC (permalink / raw)
  To: Eric Wong; +Cc: Luis Henriques, git

Eric Wong <normalperson@yhbt.net> writes:

> Luis Henriques <henrix@camandro.org> wrote:
>> On Mon, Mar 24, 2014 at 09:38:27PM +0000, Luis Henriques wrote:
>> > Add --[no-]xmailer that allows a user to disable adding the 'X-Mailer:'
>> > header to the email being sent.
>> >
>> 
>> Ping
>> 
>> It's been a while since I sent this patch.  Is there any interest in
>> having this switch in git-send-email?
>
> I wasn't paying attention when the original was sent, but this
> looks good to me.
>
> Acked-by: Eric Wong <normalperson@yhbt.net>
>
>> I honestly don't like disclosing too much information about my system,
>> in this case which MUA I'm using and its version.
>
> Right on.  I would even favor this being the default.
>
> Auto-generated Message-Id headers also shows the use of git-send-email;
> perhaps there can be a way to configure that, too.  However,
> git-send-email respects manually-added Message-Id headers in the
> original patch, so it's less of a problem, I suppose.

I actually do not think this is a good idea from debuggability.

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

* Re: [RFC][PATCH] send-email: add --[no-]xmailer option
  2014-03-24 21:38 [RFC][PATCH] send-email: add --[no-]xmailer option Luis Henriques
  2014-12-02 19:32 ` Luis Henriques
@ 2014-12-03 17:08 ` Junio C Hamano
  2014-12-03 17:23   ` Junio C Hamano
  1 sibling, 1 reply; 13+ messages in thread
From: Junio C Hamano @ 2014-12-03 17:08 UTC (permalink / raw)
  To: Luis Henriques; +Cc: git

Luis Henriques <henrix@camandro.org> writes:

> +--xmailer::
> +	Prevent adding the "X-Mailer:" header.  Default value is
> +	'sendemail.xmailer'.

Two problems here.

 - "git send-email --xmailer" would _ADD_, not prevent adding, the
   header, regardless of the value of sendemail.xmailer.

 - It is unspecified what happens when you do not have
   sendemail.xmailer and do not give the --xmailer option.

Perhaps

--xmailer::
--no-xmailer::

	By default, `git send-email` adds an "X-Mailer:" header to
        the message to identify the version of itself.  The
        `--no-xmailer` option can be used to turn this off (setting
        the `sendemail.xmailer` configuration to false has the same
        effect).  The `--xmailer` option from the command line is
        useful to countermand `sendemail.xmailer` that is set to
        `false`.

or something?


> diff --git a/git-send-email.perl b/git-send-email.perl
> index fdb0029..8789124 100755
> --- a/git-send-email.perl
> +++ b/git-send-email.perl
> @@ -54,6 +54,7 @@ git send-email [options] <file | directory | rev-list options >
>      --[no-]bcc              <str>  * Email Bcc:
>      --subject               <str>  * Email "Subject:"
>      --in-reply-to           <str>  * Email "In-Reply-To:"
> +    --[no-]xmailer                 * Don't add "X-Mailer:" header.  Default on.

The same confusion exists here.  "Don't ... default on" hints that
by default we won't see "X-mailer:" which is not true.

A way to avoid confusion is to describe what the option is about for
the positive variant, just like it is done for "--[no-]annotate"
option below.

> @@ -174,6 +175,9 @@ my $force = 0;
>  my $multiedit;
>  my $editor;
>  
> +# Usage of X-Mailer email header
> +my $xmailer;
> +
>  sub do_edit {
>  	if (!defined($editor)) {
>  		$editor = Git::command_oneline('var', 'GIT_EDITOR');
> @@ -214,7 +218,8 @@ my %config_bool_settings = (
>      "signedoffcc" => [\$signed_off_by_cc, undef],      # Deprecated
>      "validate" => [\$validate, 1],
>      "multiedit" => [\$multiedit, undef],
> -    "annotate" => [\$annotate, undef]
> +    "annotate" => [\$annotate, undef],
> +    "xmailer" => [\$xmailer, 1]
>  );
>  
>  my %config_settings = (
> @@ -311,6 +316,7 @@ my $rc = GetOptions("h" => \$help,
>  		    "8bit-encoding=s" => \$auto_8bit_encoding,
>  		    "compose-encoding=s" => \$compose_encoding,
>  		    "force" => \$force,
> +		    "xmailer!" => \$xmailer,
>  	 );
>  
>  usage() if $help;
> @@ -1144,8 +1150,10 @@ To: $to${ccline}
>  Subject: $subject
>  Date: $date
>  Message-Id: $message_id
> -X-Mailer: git-send-email $gitversion
>  ";
> +	if ($xmailer) {
> +		$header .= "X-Mailer: git-send-email $gitversion\n";
> +	}
>  	if ($reply_to) {
>  
>  		$header .= "In-Reply-To: $reply_to\n";

tests?

Thanks.

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

* Re: [RFC][PATCH] send-email: add --[no-]xmailer option
  2014-12-03 17:08 ` Junio C Hamano
@ 2014-12-03 17:23   ` Junio C Hamano
  2014-12-03 17:39     ` Junio C Hamano
  2014-12-03 18:02     ` Luis Henriques
  0 siblings, 2 replies; 13+ messages in thread
From: Junio C Hamano @ 2014-12-03 17:23 UTC (permalink / raw)
  To: Luis Henriques; +Cc: git

Junio C Hamano <gitster@pobox.com> writes:

> Two problems here.
> ...
> tests?

Something like this squashed into the patch you posted earlier,
perhaps, would be a good place to start.

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

diff --git a/Documentation/git-send-email.txt b/Documentation/git-send-email.txt
index f2425ef..a0bd806 100644
--- a/Documentation/git-send-email.txt
+++ b/Documentation/git-send-email.txt
@@ -132,8 +132,10 @@ Note that no attempts whatsoever are made to validate the encoding.
 	'sendemail.composeencoding'; if that is unspecified, UTF-8 is assumed.
 
 --xmailer::
-	Prevent adding the "X-Mailer:" header.  Default value is
-	'sendemail.xmailer'.
+--no-xmailer::
+	Add (or prevent adding) the "X-Mailer:" header.  By default,
+	the header is added, but it can be turned off by setting the
+	`sendemail.xmailer` configuration variable to `false`.
 
 Sending
 ~~~~~~~
diff --git a/git-send-email.perl b/git-send-email.perl
index 9ca7c5b..a6e66b9 100755
--- a/git-send-email.perl
+++ b/git-send-email.perl
@@ -54,7 +54,7 @@ sub usage {
     --[no-]bcc              <str>  * Email Bcc:
     --subject               <str>  * Email "Subject:"
     --in-reply-to           <str>  * Email "In-Reply-To:"
-    --[no-]xmailer                 * Don't add "X-Mailer:" header.  Default on.
+    --[no-]xmailer                 * Add "X-Mailer:" header (default).
     --[no-]annotate                * Review each patch that will be sent in an editor.
     --compose                      * Open an editor for introduction.
     --compose-encoding      <str>  * Encoding to assume for introduction.
@@ -177,8 +177,7 @@ sub format_2822_time {
 my $multiedit;
 my $editor;
 
-# Usage of X-Mailer email header
-my $xmailer;
+my $use_xmailer;
 
 sub do_edit {
 	if (!defined($editor)) {
@@ -224,7 +223,7 @@ sub do_edit {
     "validate" => [\$validate, 1],
     "multiedit" => [\$multiedit, undef],
     "annotate" => [\$annotate, undef],
-    "xmailer" => [\$xmailer, 1]
+    "xmailer" => [\$use_xmailer, 1]
 );
 
 my %config_settings = (
@@ -323,7 +322,7 @@ sub signal_handler {
 		    "8bit-encoding=s" => \$auto_8bit_encoding,
 		    "compose-encoding=s" => \$compose_encoding,
 		    "force" => \$force,
-		    "xmailer!" => \$xmailer,
+		    "xmailer!" => \$use_xmailer,
 	 );
 
 usage() if $help;
@@ -1170,7 +1169,7 @@ sub send_message {
 Date: $date
 Message-Id: $message_id
 ";
-	if ($xmailer) {
+	if ($use_xmailer) {
 		$header .= "X-Mailer: git-send-email $gitversion\n";
 	}
 	if ($reply_to) {
-- 
2.2.0-141-gd3f4719

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

* Re: [RFC][PATCH] send-email: add --[no-]xmailer option
  2014-12-03 17:23   ` Junio C Hamano
@ 2014-12-03 17:39     ` Junio C Hamano
  2014-12-03 18:02     ` Luis Henriques
  1 sibling, 0 replies; 13+ messages in thread
From: Junio C Hamano @ 2014-12-03 17:39 UTC (permalink / raw)
  To: Luis Henriques; +Cc: git

Junio C Hamano <gitster@pobox.com> writes:

> @@ -177,8 +177,7 @@ sub format_2822_time {
>  my $multiedit;
>  my $editor;
>  
> -# Usage of X-Mailer email header
> -my $xmailer;
> +my $use_xmailer;

Just another small thing.  The version of "SQUASH???" commit I will
queue on 'pu' will have this next to where $annotate is defined.

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

* Re: [RFC][PATCH] send-email: add --[no-]xmailer option
  2014-12-03 17:23   ` Junio C Hamano
  2014-12-03 17:39     ` Junio C Hamano
@ 2014-12-03 18:02     ` Luis Henriques
  1 sibling, 0 replies; 13+ messages in thread
From: Luis Henriques @ 2014-12-03 18:02 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git

On Wed, Dec 03, 2014 at 09:23:11AM -0800, Junio C Hamano wrote:
> Junio C Hamano <gitster@pobox.com> writes:
> 
> > Two problems here.
> > ...
> > tests?
> 
> Something like this squashed into the patch you posted earlier,
> perhaps, would be a good place to start.
>

Awesome, thank you for your review.  I'll post a new version of the
patch including your suggestions.  Regarding the tests, I'll need a
bit more time to work on those.

Cheers,
-- 
Luís


>  Documentation/git-send-email.txt |  6 ++++--
>  git-send-email.perl              | 11 +++++------
>  2 files changed, 9 insertions(+), 8 deletions(-)
> 
> diff --git a/Documentation/git-send-email.txt b/Documentation/git-send-email.txt
> index f2425ef..a0bd806 100644
> --- a/Documentation/git-send-email.txt
> +++ b/Documentation/git-send-email.txt
> @@ -132,8 +132,10 @@ Note that no attempts whatsoever are made to validate the encoding.
>  	'sendemail.composeencoding'; if that is unspecified, UTF-8 is assumed.
>  
>  --xmailer::
> -	Prevent adding the "X-Mailer:" header.  Default value is
> -	'sendemail.xmailer'.
> +--no-xmailer::
> +	Add (or prevent adding) the "X-Mailer:" header.  By default,
> +	the header is added, but it can be turned off by setting the
> +	`sendemail.xmailer` configuration variable to `false`.
>  
>  Sending
>  ~~~~~~~
> diff --git a/git-send-email.perl b/git-send-email.perl
> index 9ca7c5b..a6e66b9 100755
> --- a/git-send-email.perl
> +++ b/git-send-email.perl
> @@ -54,7 +54,7 @@ sub usage {
>      --[no-]bcc              <str>  * Email Bcc:
>      --subject               <str>  * Email "Subject:"
>      --in-reply-to           <str>  * Email "In-Reply-To:"
> -    --[no-]xmailer                 * Don't add "X-Mailer:" header.  Default on.
> +    --[no-]xmailer                 * Add "X-Mailer:" header (default).
>      --[no-]annotate                * Review each patch that will be sent in an editor.
>      --compose                      * Open an editor for introduction.
>      --compose-encoding      <str>  * Encoding to assume for introduction.
> @@ -177,8 +177,7 @@ sub format_2822_time {
>  my $multiedit;
>  my $editor;
>  
> -# Usage of X-Mailer email header
> -my $xmailer;
> +my $use_xmailer;
>  
>  sub do_edit {
>  	if (!defined($editor)) {
> @@ -224,7 +223,7 @@ sub do_edit {
>      "validate" => [\$validate, 1],
>      "multiedit" => [\$multiedit, undef],
>      "annotate" => [\$annotate, undef],
> -    "xmailer" => [\$xmailer, 1]
> +    "xmailer" => [\$use_xmailer, 1]
>  );
>  
>  my %config_settings = (
> @@ -323,7 +322,7 @@ sub signal_handler {
>  		    "8bit-encoding=s" => \$auto_8bit_encoding,
>  		    "compose-encoding=s" => \$compose_encoding,
>  		    "force" => \$force,
> -		    "xmailer!" => \$xmailer,
> +		    "xmailer!" => \$use_xmailer,
>  	 );
>  
>  usage() if $help;
> @@ -1170,7 +1169,7 @@ sub send_message {
>  Date: $date
>  Message-Id: $message_id
>  ";
> -	if ($xmailer) {
> +	if ($use_xmailer) {
>  		$header .= "X-Mailer: git-send-email $gitversion\n";
>  	}
>  	if ($reply_to) {
> -- 
> 2.2.0-141-gd3f4719
> 

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

* Re: [RFC][PATCH] send-email: add --[no-]xmailer option
  2014-12-03 16:56     ` Junio C Hamano
@ 2014-12-04 19:22       ` Luis Henriques
  2014-12-04 19:33         ` Junio C Hamano
  0 siblings, 1 reply; 13+ messages in thread
From: Luis Henriques @ 2014-12-04 19:22 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: Eric Wong, git

On Wed, Dec 03, 2014 at 08:56:45AM -0800, Junio C Hamano wrote:
> Eric Wong <normalperson@yhbt.net> writes:
> 
> > Luis Henriques <henrix@camandro.org> wrote:
> >> On Mon, Mar 24, 2014 at 09:38:27PM +0000, Luis Henriques wrote:
> >> > Add --[no-]xmailer that allows a user to disable adding the 'X-Mailer:'
> >> > header to the email being sent.
> >> >
> >> 
> >> Ping
> >> 
> >> It's been a while since I sent this patch.  Is there any interest in
> >> having this switch in git-send-email?
> >
> > I wasn't paying attention when the original was sent, but this
> > looks good to me.
> >
> > Acked-by: Eric Wong <normalperson@yhbt.net>
> >
> >> I honestly don't like disclosing too much information about my system,
> >> in this case which MUA I'm using and its version.
> >
> > Right on.  I would even favor this being the default.
> >
> > Auto-generated Message-Id headers also shows the use of git-send-email;
> > perhaps there can be a way to configure that, too.  However,
> > git-send-email respects manually-added Message-Id headers in the
> > original patch, so it's less of a problem, I suppose.
> 
> I actually do not think this is a good idea from debuggability.

Do you think this could be merged with yet another switch?  I can't
think of a name for the switch, something like... "--hide-msgid"?

Another option would be to re-work the --no-xmailer switch to change
it into a "--hide-id" (or something), where both the "X-Mailer:"
header would be dropped and the Message-id would be obfuscated.

Cheers,
-- 
Luís

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

* Re: [RFC][PATCH] send-email: add --[no-]xmailer option
  2014-12-04 19:22       ` Luis Henriques
@ 2014-12-04 19:33         ` Junio C Hamano
  2014-12-04 19:44           ` Luis Henriques
  0 siblings, 1 reply; 13+ messages in thread
From: Junio C Hamano @ 2014-12-04 19:33 UTC (permalink / raw)
  To: Luis Henriques; +Cc: Eric Wong, git

Luis Henriques <henrix@camandro.org> writes:

> On Wed, Dec 03, 2014 at 08:56:45AM -0800, Junio C Hamano wrote:
>
>> I actually do not think this is a good idea from debuggability.
>
> Do you think this could be merged with yet another switch?  I can't
> think of a name for the switch, something like... "--hide-msgid"?

In case it wasn't clear, by "this" I meant the removal of
"X-Mailer:", iow, "Adding --no-xmailer option is a bad idea from
debuggability's point of view".

Not adding message-id is not an option; MSAs are supposed to always
add one if they want to be RFC compliant, aren't they?

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

* Re: [RFC][PATCH] send-email: add --[no-]xmailer option
  2014-12-04 19:33         ` Junio C Hamano
@ 2014-12-04 19:44           ` Luis Henriques
  0 siblings, 0 replies; 13+ messages in thread
From: Luis Henriques @ 2014-12-04 19:44 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: Eric Wong, git, Kyle J. McKay

On Thu, Dec 04, 2014 at 11:33:24AM -0800, Junio C Hamano wrote:
> Luis Henriques <henrix@camandro.org> writes:
> 
> > On Wed, Dec 03, 2014 at 08:56:45AM -0800, Junio C Hamano wrote:
> >
> >> I actually do not think this is a good idea from debuggability.
> >
> > Do you think this could be merged with yet another switch?  I can't
> > think of a name for the switch, something like... "--hide-msgid"?
> 
> In case it wasn't clear, by "this" I meant the removal of
> "X-Mailer:", iow, "Adding --no-xmailer option is a bad idea from
> debuggability's point of view".
>

Oh, ok.  I thought you were talking about the message-id.

> Not adding message-id is not an option; MSAs are supposed to always
> add one if they want to be RFC compliant, aren't they?

Yes, of course -- having a message ID is a requirement.  But I was
hoping you could accept a solution similar to the one suggested by
Kyle (adding him to Cc): he was suggesting hashing the message ID,
which would be a good compromise, I believe.

Cheers,
-- 
Luís

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

end of thread, other threads:[~2014-12-04 19:45 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-03-24 21:38 [RFC][PATCH] send-email: add --[no-]xmailer option Luis Henriques
2014-12-02 19:32 ` Luis Henriques
2014-12-03  2:34   ` Eric Wong
2014-12-03  3:22     ` Kyle J. McKay
2014-12-03 10:13       ` Luis Henriques
2014-12-03 16:56     ` Junio C Hamano
2014-12-04 19:22       ` Luis Henriques
2014-12-04 19:33         ` Junio C Hamano
2014-12-04 19:44           ` Luis Henriques
2014-12-03 17:08 ` Junio C Hamano
2014-12-03 17:23   ` Junio C Hamano
2014-12-03 17:39     ` Junio C Hamano
2014-12-03 18:02     ` Luis Henriques

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 NNTP newsgroup(s).