mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Daniel Mack <daniel@caiaq.de>
To: linux-kernel@vger.kernel.org
Cc: Daniel Mack <daniel@caiaq.de>, Joe Perches <joe@perches.com>,
	Andrew Morton <akpm@linux-foundation.org>
Subject: [PATCH] scripts/get_maintainer.pl: add ability to read from STDIN
Date: Wed,  3 Feb 2010 02:30:12 +0800	[thread overview]
Message-ID: <1265135412-18391-1-git-send-email-daniel@caiaq.de> (raw)

This is useful for finding people for the Cc: list without dumping the
patch to a file before. You can just run

  git diff --cached | scripts/get_maintainer.pl -

now.

Signed-off-by: Daniel Mack <daniel@caiaq.de>
Cc: Joe Perches <joe@perches.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
---
 scripts/get_maintainer.pl |    9 +++++++--
 1 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/scripts/get_maintainer.pl b/scripts/get_maintainer.pl
index 090f248..3394131 100755
--- a/scripts/get_maintainer.pl
+++ b/scripts/get_maintainer.pl
@@ -237,7 +237,7 @@ foreach my $file (@ARGV) {
     ##if $file is a directory and it lacks a trailing slash, add one
     if ((-d $file)) {
 	$file =~ s@([^/])$@$1/@;
-    } elsif (!(-f $file)) {
+    } elsif ($file ne "-" && !(-f $file)) {
 	die "$P: file '${file}' not found\n";
     }
     if ($from_filename) {
@@ -255,7 +255,11 @@ foreach my $file (@ARGV) {
     } else {
 	my $file_cnt = @files;
 	my $lastfile;
-	open(PATCH, "<$file") or die "$P: Can't open ${file}\n";
+	if ($file eq "-") {
+		open(PATCH, "<$file") or die "$P: Can't open ${file}\n";
+	} else {
+		open(PATCH, "<") or die "$P: Can't read from STDIN\n";
+	}
 	while (<PATCH>) {
 	    my $patch_line = $_;
 	    if (m/^\+\+\+\s+(\S+)/) {
@@ -496,6 +500,7 @@ Notes:
           --git-min-signatures, --git-max-maintainers, --git-min-percent, and
           --git-blame
       Use --hg-since not --git-since to control date selection
+  You can pass '-' as argument to read the patch file from STDIN
 EOT
 }
 
-- 
1.6.3.3


             reply	other threads:[~2010-02-03  5:26 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-02-02 18:30 Daniel Mack [this message]
2010-02-03  5:35 ` Joe Perches
2010-02-03  7:27   ` Borislav Petkov
2010-02-03 20:34     ` Joe Perches

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=1265135412-18391-1-git-send-email-daniel@caiaq.de \
    --to=daniel@caiaq.de \
    --cc=akpm@linux-foundation.org \
    --cc=joe@perches.com \
    --cc=linux-kernel@vger.kernel.org \
    /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

all inboxes | Powered by JetHome®