public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] scripts/get_maintainer.pl: Default to --no-rolestats when output not a terminal
@ 2012-08-03 18:27 Josh Triplett
  2012-08-03 18:33 ` Joe Perches
  0 siblings, 1 reply; 5+ messages in thread
From: Josh Triplett @ 2012-08-03 18:27 UTC (permalink / raw)
  To: Alex Kelly, Andrew Morton, Joe Perches, Ian Campbell,
	Richard Weinberger, linux-kernel

scripts/get_maintainer.pl defaults to showing --rolestats, which
provides annotations explaining why each person or list might want to
know about a patch.  This works well for interactive use, but breaks
when used with git send-email's --to-cmd or --cc-cmd, resulting in
malformed email headers and mails sent to some but not all recipients.

To avoid the need to explicitly pass --no-rolestats for batch use,
enable --rolestats by default only when outputting to a terminal.

Reported-by: Alex Kelly <alex.page.kelly@gmail.com>
Signed-off-by: Josh Triplett <josh@joshtriplett.org>
---
 scripts/get_maintainer.pl |   13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)

diff --git a/scripts/get_maintainer.pl b/scripts/get_maintainer.pl
index 8b673dd..dcb0748 100755
--- a/scripts/get_maintainer.pl
+++ b/scripts/get_maintainer.pl
@@ -40,7 +40,8 @@ my $email_use_mailmap = 1;
 my $output_multiline = 1;
 my $output_separator = ", ";
 my $output_roles = 0;
-my $output_rolestats = 1;
+my $output_rolestats = 0;
+$output_rolestats = 1 if -t STDOUT;
 my $scm = 0;
 my $web = 0;
 my $subsystem = 0;
@@ -768,7 +769,8 @@ Other options:
 
 Default options:
   [--email --nogit --git-fallback --m --n --l --multiline -pattern-depth=0
-   --remove-duplicates --rolestats]
+   --remove-duplicates]
+  When outputting to a terminal, --rolestats defaults to enabled.
 
 Notes:
   Using "-f directory" may give unexpected results:
@@ -781,9 +783,10 @@ Notes:
       Used with "--git-blame", does not iterate all files in directory
   Using "--git-blame" is slow and may add old committers and authors
       that are no longer active maintainers to the output.
-  Using "--roles" or "--rolestats" with git send-email --cc-cmd or any
-      other automated tools that expect only ["name"] <email address>
-      may not work because of additional output after <email address>.
+  Using "--roles" or "--rolestats" with git send-email --to-cmd or --cc-cmd, or
+      any other automated tools that expect only ["name"] <email address> may
+      not work because of additional output after <email address>.  These
+      options default to disabled when not outputting to a terminal.
   Using "--rolestats" and "--git-blame" shows the #/total=% commits,
       not the percentage of the entire file authored.  # of commits is
       not a good measure of amount of code authored.  1 major commit may
-- 
1.7.10.4


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

end of thread, other threads:[~2012-08-04  3:57 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-08-03 18:27 [PATCH] scripts/get_maintainer.pl: Default to --no-rolestats when output not a terminal Josh Triplett
2012-08-03 18:33 ` Joe Perches
2012-08-03 18:47   ` Josh Triplett
2012-08-04  0:37     ` Joe Perches
2012-08-04  3:57       ` Josh Triplett

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox