diff options
Diffstat (limited to 'scripts/checkpatch.pl')
| -rwxr-xr-x | scripts/checkpatch.pl | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index 4b25a94cfc36..4eb355d8ae73 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl | |||
| @@ -62,6 +62,8 @@ my $conststructsfile = "$D/const_structs.checkpatch"; | |||
| 62 | my $typedefsfile = ""; | 62 | my $typedefsfile = ""; |
| 63 | my $color = "auto"; | 63 | my $color = "auto"; |
| 64 | my $allow_c99_comments = 1; # Can be overridden by --ignore C99_COMMENT_TOLERANCE | 64 | my $allow_c99_comments = 1; # Can be overridden by --ignore C99_COMMENT_TOLERANCE |
| 65 | # git output parsing needs US English output, so first set backtick child process LANGUAGE | ||
| 66 | my $git_command ='export LANGUAGE=en_US.UTF-8; git'; | ||
| 65 | 67 | ||
| 66 | sub help { | 68 | sub help { |
| 67 | my ($exitcode) = @_; | 69 | my ($exitcode) = @_; |
| @@ -904,7 +906,7 @@ sub seed_camelcase_includes { | |||
| 904 | $camelcase_seeded = 1; | 906 | $camelcase_seeded = 1; |
| 905 | 907 | ||
| 906 | if (-e ".git") { | 908 | if (-e ".git") { |
| 907 | my $git_last_include_commit = `git log --no-merges --pretty=format:"%h%n" -1 -- include`; | 909 | my $git_last_include_commit = `${git_command} log --no-merges --pretty=format:"%h%n" -1 -- include`; |
| 908 | chomp $git_last_include_commit; | 910 | chomp $git_last_include_commit; |
| 909 | $camelcase_cache = ".checkpatch-camelcase.git.$git_last_include_commit"; | 911 | $camelcase_cache = ".checkpatch-camelcase.git.$git_last_include_commit"; |
| 910 | } else { | 912 | } else { |
| @@ -932,7 +934,7 @@ sub seed_camelcase_includes { | |||
| 932 | } | 934 | } |
| 933 | 935 | ||
| 934 | if (-e ".git") { | 936 | if (-e ".git") { |
| 935 | $files = `git ls-files "include/*.h"`; | 937 | $files = `${git_command} ls-files "include/*.h"`; |
| 936 | @include_files = split('\n', $files); | 938 | @include_files = split('\n', $files); |
| 937 | } | 939 | } |
| 938 | 940 | ||
| @@ -956,7 +958,7 @@ sub git_commit_info { | |||
| 956 | 958 | ||
| 957 | return ($id, $desc) if ((which("git") eq "") || !(-e ".git")); | 959 | return ($id, $desc) if ((which("git") eq "") || !(-e ".git")); |
| 958 | 960 | ||
| 959 | my $output = `git log --no-color --format='%H %s' -1 $commit 2>&1`; | 961 | my $output = `${git_command} log --no-color --format='%H %s' -1 $commit 2>&1`; |
| 960 | $output =~ s/^\s*//gm; | 962 | $output =~ s/^\s*//gm; |
| 961 | my @lines = split("\n", $output); | 963 | my @lines = split("\n", $output); |
| 962 | 964 | ||
| @@ -1006,7 +1008,7 @@ if ($git) { | |||
| 1006 | } else { | 1008 | } else { |
| 1007 | $git_range = "-1 $commit_expr"; | 1009 | $git_range = "-1 $commit_expr"; |
| 1008 | } | 1010 | } |
| 1009 | my $lines = `git log --no-color --no-merges --pretty=format:'%H %s' $git_range`; | 1011 | my $lines = `${git_command} log --no-color --no-merges --pretty=format:'%H %s' $git_range`; |
| 1010 | foreach my $line (split(/\n/, $lines)) { | 1012 | foreach my $line (split(/\n/, $lines)) { |
| 1011 | $line =~ /^([0-9a-fA-F]{40,40}) (.*)$/; | 1013 | $line =~ /^([0-9a-fA-F]{40,40}) (.*)$/; |
| 1012 | next if (!defined($1) || !defined($2)); | 1014 | next if (!defined($1) || !defined($2)); |
