Re: [U-Boot] [PATCH 2/2] patman: Add all CC addresses to the cover letter

2012-12-03 Thread Simon Glass
On Fri, Nov 30, 2012 at 4:25 PM, Doug Anderson diand...@chromium.org wrote:
 If we're sending a cover letter make sure to CC everyone that we're
 CCing on each of the individual patches.

 Signed-off-by: Doug Anderson diand...@chromium.org

Looks good, but can you please add a note to the README under the
'Where Patches Are Sent' header which mentions where the cover letter
is sent?

 ---
  tools/patman/patman.py |2 +-
  tools/patman/series.py |   12 +++-
  2 files changed, 12 insertions(+), 2 deletions(-)

 diff --git a/tools/patman/patman.py b/tools/patman/patman.py
 index de8314a..4181d80 100755
 --- a/tools/patman/patman.py
 +++ b/tools/patman/patman.py
 @@ -140,7 +140,7 @@ else:
  options.count + options.start):
  ok = False

 -cc_file = series.MakeCcFile(options.process_tags)
 +cc_file = series.MakeCcFile(options.process_tags, cover_fname)

  # Email the patches out (giving the user time to check / cancel)
  cmd = ''
 diff --git a/tools/patman/series.py b/tools/patman/series.py
 index ad8288d..083af0f 100644
 --- a/tools/patman/series.py
 +++ b/tools/patman/series.py
 @@ -19,6 +19,7 @@
  # MA 02111-1307 USA
  #

 +import itertools
  import os

  import gitutil
 @@ -138,6 +139,9 @@ class Series(dict):
  print 'Prefix:\t ', self.get('prefix')
  if self.cover:
  print 'Cover: %d lines' % len(self.cover)
 +all_ccs = itertools.chain(*self._generated_cc.values())
 +for email in set(all_ccs):
 +print '  Cc: ',email
  if cmd:
  print 'Git command: %s' % cmd

 @@ -201,27 +205,33 @@ class Series(dict):
  str = 'Change log exists, but no version is set'
  print col.Color(col.RED, str)

 -def MakeCcFile(self, process_tags):
 +def MakeCcFile(self, process_tags, cover_fname):
  Make a cc file for us to use for per-commit Cc automation

  Also stores in self._generated_cc to make ShowActions() faster.

  Args:
  process_tags: Process tags as if they were aliases
 +cover_fname: If non-None the name of the cover letter.
  Return:
  Filename of temp file created
  
  # Look for commit tags (of the form 'xxx:' at the start of the 
 subject)
  fname = '/tmp/patman.%d' % os.getpid()
  fd = open(fname, 'w')
 +all_ccs = []
  for commit in self.commits:
  list = []
  if process_tags:
  list += gitutil.BuildEmailList(commit.tags)
  list += gitutil.BuildEmailList(commit.cc_list)
 +all_ccs += list
  print fd, commit.patch, ', '.join(list)
  self._generated_cc[commit.patch] = list

 +if cover_fname:
 +print fd, cover_fname, ', '.join(set(all_ccs))
 +
  fd.close()
  return fname

 --
 1.7.7.3


Regards,
Simon
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 2/2] patman: Add all CC addresses to the cover letter

2012-12-03 Thread Doug Anderson
Simon,

Thanks for the review!

On Mon, Dec 3, 2012 at 3:00 PM, Simon Glass s...@chromium.org wrote:
 On Fri, Nov 30, 2012 at 4:25 PM, Doug Anderson diand...@chromium.org wrote:
 If we're sending a cover letter make sure to CC everyone that we're
 CCing on each of the individual patches.

 Signed-off-by: Doug Anderson diand...@chromium.org

 Looks good, but can you please add a note to the README under the
 'Where Patches Are Sent' header which mentions where the cover letter
 is sent?

Good suggestion.  Done.

 ---
  tools/patman/patman.py |2 +-
  tools/patman/series.py |   12 +++-
  2 files changed, 12 insertions(+), 2 deletions(-)

 diff --git a/tools/patman/patman.py b/tools/patman/patman.py
 index de8314a..4181d80 100755
 --- a/tools/patman/patman.py
 +++ b/tools/patman/patman.py
 @@ -140,7 +140,7 @@ else:
  options.count + options.start):
  ok = False

 -cc_file = series.MakeCcFile(options.process_tags)
 +cc_file = series.MakeCcFile(options.process_tags, cover_fname)

  # Email the patches out (giving the user time to check / cancel)
  cmd = ''
 diff --git a/tools/patman/series.py b/tools/patman/series.py
 index ad8288d..083af0f 100644
 --- a/tools/patman/series.py
 +++ b/tools/patman/series.py
 @@ -19,6 +19,7 @@
  # MA 02111-1307 USA
  #

 +import itertools
  import os

  import gitutil
 @@ -138,6 +139,9 @@ class Series(dict):
  print 'Prefix:\t ', self.get('prefix')
  if self.cover:
  print 'Cover: %d lines' % len(self.cover)
 +all_ccs = itertools.chain(*self._generated_cc.values())
 +for email in set(all_ccs):
 +print '  Cc: ',email
  if cmd:
  print 'Git command: %s' % cmd

 @@ -201,27 +205,33 @@ class Series(dict):
  str = 'Change log exists, but no version is set'
  print col.Color(col.RED, str)

 -def MakeCcFile(self, process_tags):
 +def MakeCcFile(self, process_tags, cover_fname):
  Make a cc file for us to use for per-commit Cc automation

  Also stores in self._generated_cc to make ShowActions() faster.

  Args:
  process_tags: Process tags as if they were aliases
 +cover_fname: If non-None the name of the cover letter.
  Return:
  Filename of temp file created
  
  # Look for commit tags (of the form 'xxx:' at the start of the 
 subject)
  fname = '/tmp/patman.%d' % os.getpid()
  fd = open(fname, 'w')
 +all_ccs = []
  for commit in self.commits:
  list = []
  if process_tags:
  list += gitutil.BuildEmailList(commit.tags)
  list += gitutil.BuildEmailList(commit.cc_list)
 +all_ccs += list
  print fd, commit.patch, ', '.join(list)
  self._generated_cc[commit.patch] = list

 +if cover_fname:
 +print fd, cover_fname, ', '.join(set(all_ccs))
 +
  fd.close()
  return fname

 --
 1.7.7.3


 Regards,
 Simon
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH 2/2] patman: Add all CC addresses to the cover letter

2012-11-30 Thread Doug Anderson
If we're sending a cover letter make sure to CC everyone that we're
CCing on each of the individual patches.

Signed-off-by: Doug Anderson diand...@chromium.org
---
 tools/patman/patman.py |2 +-
 tools/patman/series.py |   12 +++-
 2 files changed, 12 insertions(+), 2 deletions(-)

diff --git a/tools/patman/patman.py b/tools/patman/patman.py
index de8314a..4181d80 100755
--- a/tools/patman/patman.py
+++ b/tools/patman/patman.py
@@ -140,7 +140,7 @@ else:
 options.count + options.start):
 ok = False
 
-cc_file = series.MakeCcFile(options.process_tags)
+cc_file = series.MakeCcFile(options.process_tags, cover_fname)
 
 # Email the patches out (giving the user time to check / cancel)
 cmd = ''
diff --git a/tools/patman/series.py b/tools/patman/series.py
index ad8288d..083af0f 100644
--- a/tools/patman/series.py
+++ b/tools/patman/series.py
@@ -19,6 +19,7 @@
 # MA 02111-1307 USA
 #
 
+import itertools
 import os
 
 import gitutil
@@ -138,6 +139,9 @@ class Series(dict):
 print 'Prefix:\t ', self.get('prefix')
 if self.cover:
 print 'Cover: %d lines' % len(self.cover)
+all_ccs = itertools.chain(*self._generated_cc.values())
+for email in set(all_ccs):
+print '  Cc: ',email
 if cmd:
 print 'Git command: %s' % cmd
 
@@ -201,27 +205,33 @@ class Series(dict):
 str = 'Change log exists, but no version is set'
 print col.Color(col.RED, str)
 
-def MakeCcFile(self, process_tags):
+def MakeCcFile(self, process_tags, cover_fname):
 Make a cc file for us to use for per-commit Cc automation
 
 Also stores in self._generated_cc to make ShowActions() faster.
 
 Args:
 process_tags: Process tags as if they were aliases
+cover_fname: If non-None the name of the cover letter.
 Return:
 Filename of temp file created
 
 # Look for commit tags (of the form 'xxx:' at the start of the subject)
 fname = '/tmp/patman.%d' % os.getpid()
 fd = open(fname, 'w')
+all_ccs = []
 for commit in self.commits:
 list = []
 if process_tags:
 list += gitutil.BuildEmailList(commit.tags)
 list += gitutil.BuildEmailList(commit.cc_list)
+all_ccs += list
 print fd, commit.patch, ', '.join(list)
 self._generated_cc[commit.patch] = list
 
+if cover_fname:
+print fd, cover_fname, ', '.join(set(all_ccs))
+
 fd.close()
 return fname
 
-- 
1.7.7.3

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot