From: Florian Mickler <florian@mickler.org>
To: Joe Perches <joe@perches.com>
Cc: Valdis.Kletnieks@vt.edu,
Andrew Morton <akpm@linux-foundation.org>,
"Stephen Hemminger (role:commit_signer)" <shemminger@vyatta.com>,
"Wolfram Sang (role:commit_signer)" <w.sang@pengutronix.de>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] get_maintainer.pl: Look for .get_maintainer.conf in lk, then $HOME then scripts
Date: Mon, 13 Sep 2010 08:13:30 +0200 [thread overview]
Message-ID: <20100913081330.57ab03bc@schatten.dmk.lab> (raw)
In-Reply-To: <1284355299.22185.65.camel@Joe-Laptop>
On Sun, 12 Sep 2010 22:21:39 -0700
Joe Perches <joe@perches.com> wrote:
> On Mon, 2010-09-13 at 00:01 -0400, Valdis.Kletnieks@vt.edu wrote:
> > Any chance of getting that to be ~/.get_maintainer.conf rather than
> > ./.get_maintainer.conf? I've just gotten bit like the 3rd or 4th time by "oh but
> > you didn't create that file in *this* tree" (I usually have a linus git tree, a linux-next
> > tree, and 3-4 -mm trees lying around).
>
> Sure.
>
> Signed-off-by: Joe Perches <joe@perches.com>
> ---
> diff --git a/scripts/get_maintainer.pl b/scripts/get_maintainer.pl
> index b228198..ea54561 100755
> --- a/scripts/get_maintainer.pl
> +++ b/scripts/get_maintainer.pl
> @@ -107,10 +107,12 @@ my %VCS_cmds_hg = (
> "blame_commit_pattern" => "^([0-9a-f]+):"
> );
>
> -if (-f "${lk_path}.get_maintainer.conf") {
> +my $conf = which_conf(".get_maintainer.conf");
> +if (-f $conf) {
> my @conf_args;
> - open(my $conffile, '<', "${lk_path}.get_maintainer.conf")
> - or warn "$P: Can't open .get_maintainer.conf: $!\n";
> + open(my $conffile, '<', "$conf")
> + or warn "$P: Can't find a readable .get_maintainer.conf file $!\n";
> +
> while (<$conffile>) {
> my $line = $_;
>
> @@ -952,6 +954,18 @@ sub which {
> return "";
> }
>
> +sub which_conf {
> + my ($conf) = @_;
> +
> + foreach my $path (split(/:/, ".:$ENV{HOME}:.scripts")) {
> + if (-e "$path/$conf") {
> + return "$path/$conf";
> + }
> + }
> +
> + return "";
> +}
> +
> sub mailmap {
> my (@lines) = @_;
> my %hash;
>
>
What about just using an array?
From: Florian Mickler <florian@mickler.org>
Date: Mon, 13 Sep 2010 07:57:29 +0200
Subject: [PATCH] get_maintainer.pl: read also ~/.get_maintainer.conf
Read first .get_maintainer.conf from current source tree, then from
home.
This means that cmdline switches trump source-tree-config which trump
~/.get_maintainer.conf.
Signed-off-by: Florian Mickler <florian@mickler.org>
---
scripts/get_maintainer.pl | 11 ++++++++---
1 files changed, 8 insertions(+), 3 deletions(-)
diff --git a/scripts/get_maintainer.pl b/scripts/get_maintainer.pl
index b228198..937da0b 100755
--- a/scripts/get_maintainer.pl
+++ b/scripts/get_maintainer.pl
@@ -107,10 +107,15 @@ my %VCS_cmds_hg = (
"blame_commit_pattern" => "^([0-9a-f]+):"
);
-if (-f "${lk_path}.get_maintainer.conf") {
+my @configfiles = ("${lk_path}.get_maintainer.conf",
"$ENV{ HOME }/.get_maintainer.conf"); +while (my $cf =
shift(@configfiles)){ my @conf_args;
- open(my $conffile, '<', "${lk_path}.get_maintainer.conf")
- or warn "$P: Can't open .get_maintainer.conf: $!\n";
+
+ next unless (-f $cf);
+
+ open(my $conffile, '<', $cf)
+ or warn "$P: Can't open $cf: $!\n";
+
while (<$conffile>) {
my $line = $_;
--
1.7.2
next prev parent reply other threads:[~2010-09-13 6:13 UTC|newest]
Thread overview: 62+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-09-10 9:33 [PATCH] get_maintainer.pl: append reason for cc to the name by default florian
2010-09-10 9:42 ` Joe Perches
2010-09-10 9:46 ` Wolfram Sang
2010-09-10 9:53 ` Mark Brown
2010-09-10 10:04 ` Joe Perches
2010-09-10 10:18 ` Mark Brown
2010-09-10 10:47 ` Joe Perches
2010-09-10 11:07 ` Mark Brown
2010-09-11 0:22 ` [PATCH] scripts/get_maintainer.pl: Add --git-blame --rolestats "Authored lines" information Joe Perches
2010-09-11 9:38 ` Florian Mickler
2010-09-11 9:52 ` Joe Perches
2010-09-11 10:02 ` Florian Mickler
2010-09-11 10:22 ` Joe Perches
2010-09-11 19:22 ` [PATCH] Documentation/SubmittingPatches: Add and describe scripts/get_maintainer.pl Joe Perches
2010-09-11 19:34 ` Florian Mickler
2010-09-11 19:43 ` [PATCH V2] " Joe Perches
2010-09-12 16:18 ` Florian Mickler
2010-09-10 11:44 ` [PATCH] get_maintainer.pl: append reason for cc to the name by default Alan Cox
2010-09-10 10:22 ` Florian Mickler
2010-09-10 10:47 ` Joe Perches
2010-09-11 21:22 ` Joe Perches
2010-09-10 10:30 ` Florian Mickler
2010-09-10 11:04 ` Mark Brown
2010-09-10 11:15 ` Florian Mickler
2010-09-10 21:04 ` Andrew Morton
2010-09-10 21:39 ` Florian Mickler
2010-09-10 21:44 ` Joe Perches
2010-09-13 4:01 ` Valdis.Kletnieks
2010-09-13 5:21 ` [PATCH] get_maintainer.pl: Look for .get_maintainer.conf in lk, then $HOME then scripts Joe Perches
2010-09-13 6:13 ` Florian Mickler [this message]
2010-09-13 13:21 ` Valdis.Kletnieks
2010-09-10 11:11 ` [PATCH] get_maintainer.pl: append reason for cc to the name by default Florian Mickler
2010-09-10 15:12 ` Joe Perches
2010-09-11 9:34 ` Florian Mickler
2010-09-11 0:13 ` Christoph Hellwig
2010-09-11 0:31 ` Joe Perches
2010-09-11 0:45 ` Christoph Hellwig
2010-09-11 0:56 ` Joe Perches
2010-09-11 9:28 ` Florian Mickler
2010-09-13 7:16 ` Eric W. Biederman
2010-09-13 7:57 ` Joe Perches
2010-09-13 8:54 ` Florian Mickler
2010-09-14 17:19 ` Eric W. Biederman
2010-09-14 17:46 ` Florian Mickler
2010-09-15 3:28 ` Joe Perches
2010-09-15 4:34 ` Florian Mickler
2010-09-15 4:45 ` Joe Perches
2010-09-15 12:49 ` Florian Mickler
2010-09-14 23:15 ` Joe Perches
2010-09-13 9:01 ` Florian Mickler
2010-09-14 17:24 ` Eric W. Biederman
2010-09-26 18:52 ` RFC: " Joe Perches
2010-09-27 14:57 ` Florian Mickler
2010-09-27 15:44 ` Ted Ts'o
2010-09-27 17:00 ` Florian Mickler
2010-09-27 18:21 ` Ted Ts'o
2010-09-27 19:26 ` Florian Mickler
2010-09-27 20:08 ` Joe Perches
2010-09-27 20:47 ` Ted Ts'o
2010-09-27 21:16 ` Joe Perches
2010-09-28 4:22 ` Ted Ts'o
2010-09-28 4:37 ` Mark Brown
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=20100913081330.57ab03bc@schatten.dmk.lab \
--to=florian@mickler.org \
--cc=Valdis.Kletnieks@vt.edu \
--cc=akpm@linux-foundation.org \
--cc=joe@perches.com \
--cc=linux-kernel@vger.kernel.org \
--cc=shemminger@vyatta.com \
--cc=w.sang@pengutronix.de \
/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;
as well as URLs for NNTP newsgroup(s).