* outside repository fatal error
@ 2020-09-20 11:53 Julia Lawall
2020-09-20 15:34 ` Joe Perches
0 siblings, 1 reply; 4+ messages in thread
From: Julia Lawall @ 2020-09-20 11:53 UTC (permalink / raw)
To: joe, apw; +Cc: linux-kernel, linux
The commit bcf4271d4bc3 ("checkpatch: allow not using -f with files that
are in git") in linux-next seems to cause checkpatch to fail on a file
containing a patch if that file is not in the directory containing the
Linux kernel. Is that intentional?
thanks,
julia
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: outside repository fatal error
2020-09-20 11:53 outside repository fatal error Julia Lawall
@ 2020-09-20 15:34 ` Joe Perches
2020-09-20 16:03 ` Julia Lawall
2020-09-20 16:20 ` [PATCH -next] checkpatch: Fix git "fatal" warning if file argument outside kernel tree Joe Perches
0 siblings, 2 replies; 4+ messages in thread
From: Joe Perches @ 2020-09-20 15:34 UTC (permalink / raw)
To: Julia Lawall, apw; +Cc: linux-kernel, linux
On Sun, 2020-09-20 at 13:53 +0200, Julia Lawall wrote:
> The commit bcf4271d4bc3 ("checkpatch: allow not using -f with files that
> are in git") in linux-next seems to cause checkpatch to fail on a file
> containing a patch if that file is not in the directory containing the
> Linux kernel.
Thanks for the report.
> Is that intentional?
No. It doesn't really fail, it just emits a fatal
warning from git.
I believe this makes it better by silencing the error.
---
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index 3e474072aa90..469f8e7456df 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -981,7 +981,7 @@ sub git_is_single_file {
return 0 if ((which("git") eq "") || !(-e "$gitroot"));
- my $output = `${git_command} ls-files -- $filename`;
+ my $output = `${git_command} ls-files -- $filename 2>/dev/null`;
my $count = $output =~ tr/\n//;
return $count eq 1 && $output =~ m{^${filename}$};
}
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: outside repository fatal error
2020-09-20 15:34 ` Joe Perches
@ 2020-09-20 16:03 ` Julia Lawall
2020-09-20 16:20 ` [PATCH -next] checkpatch: Fix git "fatal" warning if file argument outside kernel tree Joe Perches
1 sibling, 0 replies; 4+ messages in thread
From: Julia Lawall @ 2020-09-20 16:03 UTC (permalink / raw)
To: Joe Perches; +Cc: apw, linux-kernel, linux
On Sun, 20 Sep 2020, Joe Perches wrote:
> On Sun, 2020-09-20 at 13:53 +0200, Julia Lawall wrote:
> > The commit bcf4271d4bc3 ("checkpatch: allow not using -f with files that
> > are in git") in linux-next seems to cause checkpatch to fail on a file
> > containing a patch if that file is not in the directory containing the
> > Linux kernel.
>
> Thanks for the report.
>
> > Is that intentional?
>
> No. It doesn't really fail, it just emits a fatal
> warning from git.
>
> I believe this makes it better by silencing the error.
It seems fine now.
Reviewed-by: Julia Lawall <julia.lawall@inria.fr>
julia
> ---
> diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
> index 3e474072aa90..469f8e7456df 100755
> --- a/scripts/checkpatch.pl
> +++ b/scripts/checkpatch.pl
> @@ -981,7 +981,7 @@ sub git_is_single_file {
>
> return 0 if ((which("git") eq "") || !(-e "$gitroot"));
>
> - my $output = `${git_command} ls-files -- $filename`;
> + my $output = `${git_command} ls-files -- $filename 2>/dev/null`;
> my $count = $output =~ tr/\n//;
> return $count eq 1 && $output =~ m{^${filename}$};
> }
>
>
>
>
^ permalink raw reply [flat|nested] 4+ messages in thread* [PATCH -next] checkpatch: Fix git "fatal" warning if file argument outside kernel tree
2020-09-20 15:34 ` Joe Perches
2020-09-20 16:03 ` Julia Lawall
@ 2020-09-20 16:20 ` Joe Perches
1 sibling, 0 replies; 4+ messages in thread
From: Joe Perches @ 2020-09-20 16:20 UTC (permalink / raw)
To: Andrew Morton; +Cc: linux-kernel, linux, Julia Lawall, apw
commit bcf4271d4bc3 ("checkpatch: allow not using -f with files that
are in git") in linux-next causes checkpatch to emit a fatal message:
fatal: <file>: '<file>' is outside repository at '<kernel_dir>'
Fix that by sending git's error output to /dev/null instead.
Signed-off-by: Joe Perches <joe@perches.com>
Reported-by: Julia Lawall <julia.lawall@inria.fr>
Reviewed-by: Julia Lawall <julia.lawall@inria.fr>
---
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index 3e474072aa90..469f8e7456df 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -981,7 +981,7 @@ sub git_is_single_file {
return 0 if ((which("git") eq "") || !(-e "$gitroot"));
- my $output = `${git_command} ls-files -- $filename`;
+ my $output = `${git_command} ls-files -- $filename 2>/dev/null`;
my $count = $output =~ tr/\n//;
return $count eq 1 && $output =~ m{^${filename}$};
}
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2020-09-20 16:20 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-20 11:53 outside repository fatal error Julia Lawall
2020-09-20 15:34 ` Joe Perches
2020-09-20 16:03 ` Julia Lawall
2020-09-20 16:20 ` [PATCH -next] checkpatch: Fix git "fatal" warning if file argument outside kernel tree Joe Perches
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®