Git development
 help / color / mirror / Atom feed
From: Alex Chiang <achiang@hp.com>
To: catalin.marinas@gmail.com
Cc: Andrew Patterson <andrew.patterson@hp.com>,
	scameron@beardog.cce.hp.com, git@vger.kernel.org
Subject: [StGIT PATCH] allow --cc=myself to work again
Date: Fri, 13 Nov 2009 12:27:42 -0700	[thread overview]
Message-ID: <20091113192742.GC1800@ldl.fc.hp.com> (raw)

commit cd74a041 filtered duplicate email addresses, especially
with the --auto option.

However, it broke a common practice of cc'ing yourself on a
patch. [nb, I don't do this myself, but there are several legit
reasons]

This patch allows you to do something like:

	stg mail --to=<someaddr> --cc=<myaddr> --auto <patch>

Under my testing, with <myaddr> in the Signed-off-by: path:

	- we still do not send duplicates to <myaddr> (cd74a041 still holds)
	- we do not Cc: <myaddr> unless explicitly specified with --cc=

I believe this is the behaviour that closest matches what a user
actually wants without sending multiple, annoying Cc:'s.

Signed-off-by: Alex Chiang <achiang@hp.com>
---
diff --git a/stgit/commands/mail.py b/stgit/commands/mail.py
index abd42e4..4b0ac7b 100644
--- a/stgit/commands/mail.py
+++ b/stgit/commands/mail.py
@@ -272,9 +272,8 @@ def __build_address_headers(msg, options, extra_cc = []):
     cc_set = __update_header('Cc', cc_addr, to_set)
     bcc_set = __update_header('Bcc', bcc_addr, to_set.union(cc_set))
 
-    # --auto generated addresses, don't include the sender
-    from_set = __update_header('From')
-    __update_header('Cc', extra_cc_addr, to_set.union(bcc_set).union(from_set))
+    # --auto generated addresses
+    __update_header('Cc', extra_cc_addr, to_set.union(bcc_set))
 
     # update other address headers
     __update_header('Reply-To')
@@ -528,8 +527,11 @@ def __build_message(tmpl, patch, patch_nr, total_nr, msg_id, ref_id, options):
     except Exception, ex:
         raise CmdException, 'template parsing error: %s' % str(ex)
 
+    # Get signers, but filter sender from list. Results in:
+    # do not auto-cc the sender unless explicitly specified with --cc=
     if options.auto:
         extra_cc = __get_signers_list(descr)
+        extra_cc = list(set.symmetric_difference(set([sender]), set(extra_cc)))
     else:
         extra_cc = []
 

                 reply	other threads:[~2009-11-13 19:27 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20091113192742.GC1800@ldl.fc.hp.com \
    --to=achiang@hp.com \
    --cc=andrew.patterson@hp.com \
    --cc=catalin.marinas@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=scameron@beardog.cce.hp.com \
    /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