Skip to contentSkip to conversation

patman: Do not Cc addresses included in To list

PATCH New Otavio Salvador 2 participants 2 messages Aug 18, 2012 – Sep 2, 2012

lore
Share & tools
lore
#0 lore raw

PATCH v3 1/1 patman: Do not Cc addresses included in To list

In case an address is listed in the To list, those will be skipped on Cc list or user might end with a duplicated message.

This fixes the case when a tag points to same address used as series destination thus avoiding duplicated sending.

---
Changes in v2:
- use if 'to' in self: to remove the try block

Changes in v3:
- readd try / except block to handle the valid error

 tools/patman/series.py |    7 +++++++
 1 file changed, 7 insertions(+)
tools/patman/series.py +7 -0
index eda1e9b..7829dc7 100644
@@ -114,6 +114,13 @@ class Series(dict):
                 cc_list += gitutil.BuildEmailList(commit.tags)
             cc_list += gitutil.BuildEmailList(commit.cc_list)
 
+            # Skip items in To list
+            if 'to' in self:
+                try:
+                    map(cc_list.remove, gitutil.BuildEmailList(self.to))
+                except ValueError:
+                    pass
+
             for email in cc_list:
                 if email == None:
                     email = col.Color(col.YELLOW, "<alias '%s' not found>"
Signature · 1 line
1.7.10.4
#1 lore raw

PATCH v3 1/1 patman: Do not Cc addresses included in To list

Dear Otavio Salvador,

Quoted 11 lines · In message <[email protected]> you…

In case an address is listed in the To list, those will be skipped on Cc list or user might end with a duplicated message.

This fixes the case when a tag points to same address used as series destination thus avoiding duplicated sending.

---
Changes in v2:
- use if 'to' in self: to remove the try block

Quoted 5 lines

Changes in v3:
- readd try / except block to handle the valid error

 tools/patman/series.py |    7 +++++++
 1 file changed, 7 insertions(+)

Applied, thanks.

Best regards,

Wolfgang Denk

Signature · 6 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
"...all the  good  computer  designs  are  bootlegged;  the  formally
planned  products,  if  they  are built at all, are dogs!" - David E.
Lundstrom, "A Few Good Men From Univac", MIT Press, 1987