git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: "Uwe Kleine-König" <ukleinek@informatik.uni-freiburg.de>
Cc: git@vger.kernel.org,
	"Uwe Kleine-König" <Uwe.Kleine-Koenig@digi.com>,
	"Ryan Anderson" <ryan@michonline.com>
Subject: Re: [PATCH] send-email: apply --suppress-from to S-o-b and cc-cmd
Date: Wed, 07 Nov 2007 12:43:16 -0800	[thread overview]
Message-ID: <7vode5aisb.fsf@gitster.siamese.dyndns.org> (raw)
In-Reply-To: 1194420852-15822-1-git-send-email-ukleinek@informatik.uni-freiburg.de

Uwe Kleine-König  <ukleinek@informatik.uni-freiburg.de> writes:

> From: Uwe Kleine-König <Uwe.Kleine-Koenig@digi.com>
>
> Signed-off-by: Uwe Kleine-König <Uwe.Kleine-Koenig@digi.com>
> Cc: Ryan Anderson <ryan@michonline.com>
> ---
> Hello,
>
> I don't see the sense in adding the sender to Cc: from Signed-off-by
> lines but not from From:.  If someone is convinced it makes sense, I'm
> willing to send a new patch that uses a different option.

I _think_ --suppress-from just means "I know what I'll be
sending out, so do not bother my mailbox with a copy of this
message", so what the patch tries to do makes perfect sense to
me.

> @@ -730,6 +729,7 @@ foreach my $t (@files) {
>  			if (/^(Signed-off-by|Cc): (.*)$/i && $signed_off_cc) {
>  				my $c = $2;
>  				chomp $c;
> +				next if ($c eq $sender and $suppress_from);
>  				push @cc, $c;
>  				printf("(sob) Adding cc: %s from line '%s'\n",
>  					$c, $_) unless $quiet;
> @@ -745,6 +745,7 @@ foreach my $t (@files) {
>  			my $c = $_;
>  			$c =~ s/^\s*//g;
>  			$c =~ s/\n$//g;
> +			next if ($c eq $sender and $suppress_from);
>  			push @cc, $c;
>  			printf("(cc-cmd) Adding cc: %s from: '%s'\n",
>  				$c, $cc_cmd) unless $quiet;

By the way, I noticed that in the header part we pick CC: and
From: address, which are rfc2047 quoted, and unquote it to
compare with the sender.  If they are different, we push the
address, still rfc2047 quoted, to @cc, like this:

	} elsif (/^(Cc|From):\s+(.*)$/) {
		if (unquote_rfc2047($2) eq $sender) {
			next if ($suppress_from);
		}
		elsif ($1 eq 'From') {
			$author = unquote_rfc2047($2);
		}
		printf("(mbox) Adding cc: %s from line '%s'\n",
			$2, $_) unless $quiet;
		push @cc, $2;
	}

However, in the body part, when we see S-o-b: and CC: address,
which are _not_ rfc2047 quoted, do not unquote to compare with
$sender and we push it direct to @cc (the original text in the
first hunk of your patch).  We do the same for output from
$cc_cmd if specified (the second hunk).

This means that @cc list would be a mixed bag.  Some are rfc2047
quoted, and some are not.  This inconsistency of course is taken
care of by the call to sanitize_address over @cc at the very
beginning of send_message(), but it somehow feels dirty.

      reply	other threads:[~2007-11-07 20:44 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-11-07  7:34 [PATCH] send-email: apply --suppress-from to S-o-b and cc-cmd Uwe Kleine-König
2007-11-07 20:43 ` Junio C Hamano [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=7vode5aisb.fsf@gitster.siamese.dyndns.org \
    --to=gitster@pobox.com \
    --cc=Uwe.Kleine-Koenig@digi.com \
    --cc=git@vger.kernel.org \
    --cc=ryan@michonline.com \
    --cc=ukleinek@informatik.uni-freiburg.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).