scripts/checkpatch: roll diff tweaking into checkpatch itself

Rather than relying on external tweaks lets just do it inside
checkpatch's direct commitish handling which is QEMU specific code
anyway.

Suggested-by: Daniel P. Berrangé <berrange@redhat.com>
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Reviewed-by: Willian Rampazzo <willianr@redhat.com>
Reviewed-by: Wainer dos Santos Moschetta <wainersm@redhat.com>
Message-Id: <20210623102749.25686-4-alex.bennee@linaro.org>
This commit is contained in:
Alex Bennée 2021-06-23 11:27:44 +01:00
parent ae63ed1691
commit 66cf70149a
3 changed files with 6 additions and 7 deletions

View File

@ -4,9 +4,6 @@ check-patch:
needs: needs:
job: amd64-centos8-container job: amd64-centos8-container
script: script:
- git config --local diff.renamelimit 0
- git config --local diff.renames True
- git config --local diff.algorithm histogram
- .gitlab-ci.d/check-patch.py - .gitlab-ci.d/check-patch.py
variables: variables:
GIT_DEPTH: 1000 GIT_DEPTH: 1000

View File

@ -138,9 +138,6 @@ testing:
script: | script: |
#!/bin/bash #!/bin/bash
git rev-parse base > /dev/null || exit 0 git rev-parse base > /dev/null || exit 0
git config --local diff.renamelimit 0
git config --local diff.renames True
git config --local diff.algorithm histogram
./scripts/checkpatch.pl --mailback base.. ./scripts/checkpatch.pl --mailback base..
docker-mingw@fedora: docker-mingw@fedora:
enabled: true enabled: true

View File

@ -399,7 +399,12 @@ if ($chk_branch) {
my $num_patches = @patches; my $num_patches = @patches;
for my $hash (@patches) { for my $hash (@patches) {
my $FILE; my $FILE;
open($FILE, '-|', "git", "show", "--patch-with-stat", $hash) || open($FILE, '-|', "git",
"-c", "diff.renamelimit=0",
"-c", "diff.renames=True",
"-c", "diff.algorithm=histogram",
"show",
"--patch-with-stat", $hash) ||
die "$P: git show $hash - $!\n"; die "$P: git show $hash - $!\n";
while (<$FILE>) { while (<$FILE>) {
chomp; chomp;