HAOUAS Elyes has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/61471 )
Change subject: util/lint/checkpatch.pl: Use "git_command" ......................................................................
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 --- M util/lint/checkpatch.pl 1 file changed, 5 insertions(+), 4 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/71/61471/1
diff --git a/util/lint/checkpatch.pl b/util/lint/checkpatch.pl index bce724d..e9eb740 100755 --- a/util/lint/checkpatch.pl +++ b/util/lint/checkpatch.pl @@ -64,6 +64,7 @@ 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 @@ $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 @@ }
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 @@
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 @@ } 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));