Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit0f7f635

Browse files
JoePerchestorvalds
authored andcommitted
checkpatch: enable GIT_DIR environment use to set git repository location
If set, use the environment variable GIT_DIR to change the default .gitlocation of the kernel git tree.If GIT_DIR is unset, keep using the current ".git" default.Link:https://lkml.kernel.org/r/c5e23b45562373d632fccb8bc04e563abba4dd1d.camel@perches.comSigned-off-by: Joe Perches <joe@perches.com>Tested-by: Geert Uytterhoeven <geert@linux-m68k.org>Signed-off-by: Andrew Morton <akpm@linux-foundation.org>Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent672f887 commit0f7f635

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

‎scripts/checkpatch.pl‎

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,8 @@
4343
my$fix = 0;
4444
my$fix_inplace = 0;
4545
my$root;
46+
my$gitroot =$ENV{'GIT_DIR'};
47+
$gitroot =".git"if !defined($gitroot);
4648
my%debug;
4749
my%camelcase = ();
4850
my%use_type = ();
@@ -908,7 +910,7 @@ sub is_maintained_obsolete {
908910
subis_SPDX_License_valid {
909911
my ($license) =@_;
910912

911-
return 1if (!$tree || which("python")eq"" || !(-e"$root/scripts/spdxcheck.py") || !(-e"$root/.git"));
913+
return 1if (!$tree || which("python")eq"" || !(-e"$root/scripts/spdxcheck.py") || !(-e"$gitroot"));
912914

913915
my$root_path = abs_path($root);
914916
my$status =`cd "$root_path"; echo "$license" | python scripts/spdxcheck.py -`;
@@ -926,7 +928,7 @@ sub seed_camelcase_includes {
926928

927929
$camelcase_seeded = 1;
928930

929-
if (-e".git") {
931+
if (-e"$gitroot") {
930932
my$git_last_include_commit =`${git_command} log --no-merges --pretty=format:"%h%n" -1 -- include`;
931933
chomp$git_last_include_commit;
932934
$camelcase_cache =".checkpatch-camelcase.git.$git_last_include_commit";
@@ -954,7 +956,7 @@ sub seed_camelcase_includes {
954956
return;
955957
}
956958

957-
if (-e".git") {
959+
if (-e"$gitroot") {
958960
$files =`${git_command} ls-files "include/*.h"`;
959961
@include_files =split('\n',$files);
960962
}
@@ -987,7 +989,7 @@ sub git_is_single_file {
987989
subgit_commit_info {
988990
my ($commit,$id,$desc) =@_;
989991

990-
return ($id,$desc)if ((which("git")eq"") || !(-e".git"));
992+
return ($id,$desc)if ((which("git")eq"") || !(-e"$gitroot"));
991993

992994
my$output =`${git_command} log --no-color --format='%H%s' -1$commit 2>&1`;
993995
$output =~s/^\s*//gm;
@@ -1026,7 +1028,7 @@ sub git_commit_info {
10261028

10271029
# If input is git commits, extract all commits from the commit expressions.
10281030
# For example, HEAD-3 means we need check 'HEAD, HEAD~1, HEAD~2'.
1029-
die"$P: No git repository found\n"if ($git && !-e".git");
1031+
die"$P: No git repository found\n"if ($git && !-e"$gitroot");
10301032

10311033
if ($git) {
10321034
my@commits = ();

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp