diff options
author | Elyes HAOUAS <ehaouas@noos.fr> | 2022-01-29 08:31:06 +0100 |
---|---|---|
committer | Martin Roth <martinroth@google.com> | 2022-02-01 17:34:28 +0000 |
commit | f2a9c8d57ce44ddab45928cb77a48b44a615e8d0 (patch) | |
tree | ef55fed255ab231d3f594f8787eb2d7532bffe12 /util/lint | |
parent | 41aa8d60355c16959e63ae9f0bad65efd4cc64f5 (diff) |
util/lint/checkpatch.pl: Use "git_command"
This is to reduce difference with linux v5.16.
Change-Id: I7abd4d8eed856eee841422515db2ff7f50ecd0a4
Signed-off-by: Elyes HAOUAS <ehaouas@noos.fr>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/61471
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Martin Roth <martinroth@google.com>
Diffstat (limited to 'util/lint')
-rwxr-xr-x | util/lint/checkpatch.pl | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/util/lint/checkpatch.pl b/util/lint/checkpatch.pl index cd188e6bd4..3cf249c4ed 100755 --- a/util/lint/checkpatch.pl +++ b/util/lint/checkpatch.pl @@ -64,6 +64,7 @@ my $conststructsfile = "$D/const_structs.checkpatch"; my $typedefsfile = ""; my $color = "auto"; my $allow_c99_comments = 1; +my $git_command ='git'; # coreboot my $tabsize = 8; # For coreboot jenkins # If taint mode is enabled, Untaint the path - files must be in /bin, /usr/bin or /usr/local/bin @@ -870,7 +871,7 @@ sub seed_camelcase_includes { $camelcase_seeded = 1; if (-e "$gitroot") { - my $git_last_include_commit = `git log --no-merges --pretty=format:"%h%n" -1 -- include`; + my $git_last_include_commit = `${git_command} log --no-merges --pretty=format:"%h%n" -1 -- include`; chomp $git_last_include_commit; $camelcase_cache = ".checkpatch-camelcase.git.$git_last_include_commit"; } else { @@ -898,7 +899,7 @@ sub seed_camelcase_includes { } if (-e "$gitroot") { - $files = `git ls-files "include/*.h"`; + $files = `${git_command} ls-files "include/*.h"`; @include_files = split('\n', $files); } @@ -922,7 +923,7 @@ sub git_commit_info { return ($id, $desc) if ((which("git") eq "") || !(-e "$gitroot")); - my $output = `git log --no-color --format='%H %s' -1 $commit 2>&1`; + my $output = `${git_command} log --no-color --format='%H %s' -1 $commit 2>&1`; $output =~ s/^\s*//gm; my @lines = split("\n", $output); @@ -972,7 +973,7 @@ if ($git) { } else { $git_range = "-1 $commit_expr"; } - my $lines = `git log --no-color --no-merges --pretty=format:'%H %s' $git_range`; + my $lines = `${git_command} log --no-color --no-merges --pretty=format:'%H %s' $git_range`; foreach my $line (split(/\n/, $lines)) { $line =~ /^([0-9a-fA-F]{40,40}) (.*)$/; next if (!defined($1) || !defined($2)); |