Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1304368 > unrolled thread
| Started by | Dan Carpenter <dan.carpenter@oracle.com> |
|---|---|
| First post | 2016-01-08 12:00 +0100 |
| Last post | 2016-01-08 20:50 +0100 |
| Articles | 6 — 2 participants |
Back to article view | Back to linux.kernel
[patch] get_maintainer: handle file names beginning with ./ Dan Carpenter <dan.carpenter@oracle.com> - 2016-01-08 12:00 +0100
Re: [patch] get_maintainer: handle file names beginning with ./ Joe Perches <joe@perches.com> - 2016-01-08 12:40 +0100
Re: [patch] get_maintainer: handle file names beginning with ./ Dan Carpenter <dan.carpenter@oracle.com> - 2016-01-08 14:50 +0100
Re: [patch] get_maintainer: handle file names beginning with ./ Joe Perches <joe@perches.com> - 2016-01-08 18:50 +0100
Re: [patch] get_maintainer: handle file names beginning with ./ Dan Carpenter <dan.carpenter@oracle.com> - 2016-01-08 19:50 +0100
Re: [patch] get_maintainer: handle file names beginning with ./ Joe Perches <joe@perches.com> - 2016-01-08 20:50 +0100
| From | Dan Carpenter <dan.carpenter@oracle.com> |
|---|---|
| Date | 2016-01-08 12:00 +0100 |
| Subject | [patch] get_maintainer: handle file names beginning with ./ |
| Message-ID | <qOCVX-5yb-3@gated-at.bofh.it> |
The problem is that get_maintainer.pl doesn't work if you have a ./
prefix on the filename. For example, if you type:
./scripts/get_maintainer.pl -f ./drivers/usb/usb-skeleton.c
then the current code only includes LKML and people from the git log, it
doesn't include Greg or the linux-usb list.
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
diff --git a/scripts/get_maintainer.pl b/scripts/get_maintainer.pl
index cab641a..41cfe59 100755
--- a/scripts/get_maintainer.pl
+++ b/scripts/get_maintainer.pl
@@ -605,6 +605,8 @@ sub get_maintainers {
foreach my $file (@files) {
+ $file =~ s/^\.\///;
+
my %hash;
my $tvi = find_first_section();
while ($tvi < @typevalue) {
[toc] | [next] | [standalone]
| From | Joe Perches <joe@perches.com> |
|---|---|
| Date | 2016-01-08 12:40 +0100 |
| Message-ID | <qODyG-63D-17@gated-at.bofh.it> |
| In reply to | #1304368 |
On Fri, 2016-01-08 at 13:51 +0300, Dan Carpenter wrote: > The problem is that get_maintainer.pl doesn't work if you have a ./ > prefix on the filename. For example, if you type: > > ./scripts/get_maintainer.pl -f ./drivers/usb/usb-skeleton.c Someone's been feeding find output to get_maintainer? Then maybe you'd also have to consider fully qualified file names, tilde expansion, $PWD, and probably a bunch of other things too.
[toc] | [prev] | [next] | [standalone]
| From | Dan Carpenter <dan.carpenter@oracle.com> |
|---|---|
| Date | 2016-01-08 14:50 +0100 |
| Message-ID | <qOFAu-7qR-11@gated-at.bofh.it> |
| In reply to | #1304410 |
On Fri, Jan 08, 2016 at 03:37:56AM -0800, Joe Perches wrote: > On Fri, 2016-01-08 at 13:51 +0300, Dan Carpenter wrote: > > The problem is that get_maintainer.pl doesn't work if you have a ./ > > prefix on the filename. For example, if you type: > > > > ./scripts/get_maintainer.pl -f ./drivers/usb/usb-skeleton.c > > Someone's been feeding find output to get_maintainer? Yep. > > Then maybe you'd also have to consider fully qualified > file names, tilde expansion, $PWD, and probably a bunch > of other things too. I don't think you'd "have" to consider those as well, but I won't stand in your way if you want to... regards, dan carpenter
[toc] | [prev] | [next] | [standalone]
| From | Joe Perches <joe@perches.com> |
|---|---|
| Date | 2016-01-08 18:50 +0100 |
| Message-ID | <qOJkK-1BX-5@gated-at.bofh.it> |
| In reply to | #1304553 |
On Fri, 2016-01-08 at 16:44 +0300, Dan Carpenter wrote: > On Fri, Jan 08, 2016 at 03:37:56AM -0800, Joe Perches wrote: > > On Fri, 2016-01-08 at 13:51 +0300, Dan Carpenter wrote: > > > The problem is that get_maintainer.pl doesn't work if you have a ./ > > > prefix on the filename. For example, if you type: > > > > > > ./scripts/get_maintainer.pl -f ./drivers/usb/usb-skeleton.c > > > > Someone's been feeding find output to get_maintainer? > > Yep. So strip the leading './' before using it. Also, if you're looking for unmaintained files, I think have a script for that too. > > Then maybe you'd also have to consider fully qualified > > file names, tilde expansion, $PWD, and probably a bunch > > of other things too. > > I don't think you'd "have" to consider those as well, but I won't stand > in your way if you want to... Half measures aren't generally good enough. Using a combination of CWnd abs_fast_path and $lk_path is probably better. $lkpath is set to './' by default.
[toc] | [prev] | [next] | [standalone]
| From | Dan Carpenter <dan.carpenter@oracle.com> |
|---|---|
| Date | 2016-01-08 19:50 +0100 |
| Message-ID | <qOKgP-2ix-49@gated-at.bofh.it> |
| In reply to | #1304757 |
On Fri, Jan 08, 2016 at 09:47:07AM -0800, Joe Perches wrote: > > > Then maybe you'd also have to consider fully qualified > > > file names, tilde expansion, $PWD, and probably a bunch > > > of other things too. > > > > I don't think you'd "have" to consider those as well, but I won't stand > > in your way if you want to... > > Half measures aren't generally good enough. > Those are fake issues though and I can't imagine how they would affect anyone. My issue was super annoying for me because I was sending find output to a script and it was almost mailing the correct people because it was using git output. I had to debug for a long time before I spotted the difference between ./drivers/media/radio/wl128x/fmdrv_common.c and drivers/media/radio/wl128x/fmdrv_common.c. I feel like I have seen this before and just manually added the correct mailing lists back. It's crazy annoying and easy to do. > Using a combination of CWnd abs_fast_path and $lk_path > is probably better. $lkpath is set to './' by default. I have no idea what this means... It sounds like a good idea though. :) Please give me Reported-by credit. regards, dan carpenter
[toc] | [prev] | [next] | [standalone]
| From | Joe Perches <joe@perches.com> |
|---|---|
| Date | 2016-01-08 20:50 +0100 |
| Message-ID | <qOLcS-2Y5-3@gated-at.bofh.it> |
| In reply to | #1304920 |
On Fri, 2016-01-08 at 21:46 +0300, Dan Carpenter wrote:
> On Fri, Jan 08, 2016 at 09:47:07AM -0800, Joe Perches wrote:
> > > > Then maybe you'd also have to consider fully qualified
> > > > file names, tilde expansion, $PWD, and probably a bunch
> > > > of other things too.
> > >
> > > I don't think you'd "have" to consider those as well, but I won't stand
> > > in your way if you want to...
> >
> > Half measures aren't generally good enough.
> >
>
> Those are fake issues though and I can't imagine how they would affect
> anyone. My issue was super annoying for me because I was sending find
> output to a script and it was almost mailing the correct people because
> it was using git output. I had to debug for a long time before I
> spotted the difference between ./drivers/media/radio/wl128x/fmdrv_common.c
> and drivers/media/radio/wl128x/fmdrv_common.c.
>
> I feel like I have seen this before and just manually added the correct
> mailing lists back. It's crazy annoying and easy to do.
>
> > Using a combination of CWnd abs_fast_path and $lk_path
> > is probably better. $lkpath is set to './' by default.
>
> I have no idea what this means... It sounds like a good idea though.
> :) Please give me Reported-by credit.
>
Maybe this (probably won't apply because I still haven't
converted from Evolution to something that doesn't futz
up sending text emails)
---
scripts/get_maintainer.pl | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/scripts/get_maintainer.pl b/scripts/get_maintainer.pl
index cab641a..1873421 100755
--- a/scripts/get_maintainer.pl
+++ b/scripts/get_maintainer.pl
@@ -16,7 +16,9 @@ my $P = $0;
my $V = '0.26';
use Getopt::Long qw(:config no_auto_abbrev);
+use Cwd;
+my $cur_path = fastgetcwd() . '/';
my $lk_path = "./";
my $email = 1;
my $email_usename = 1;
@@ -429,6 +431,8 @@ foreach my $file (@ARGV) {
}
}
if ($from_filename) {
+ $file =~ s/^\Q${cur_path}\E//; #strip any absolute path
+ $file =~ s/^\Q${lk_path}\E//; #or the path to the lk tree
push(@files, $file);
if ($file ne "MAINTAINERS" && -f $file && ($keywords || $file_emails)) {
open(my $f, '<', $file)
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web