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>
diff --git a/.gitlab-ci.d/static_checks.yml b/.gitlab-ci.d/static_checks.yml
index 7e685c6..c5fa4fc 100644
--- a/.gitlab-ci.d/static_checks.yml
+++ b/.gitlab-ci.d/static_checks.yml
@@ -4,9 +4,6 @@
needs:
job: amd64-centos8-container
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
variables:
GIT_DEPTH: 1000
diff --git a/.patchew.yml b/.patchew.yml
index 2638b7f..1b78262 100644
--- a/.patchew.yml
+++ b/.patchew.yml
@@ -138,9 +138,6 @@
script: |
#!/bin/bash
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..
docker-mingw@fedora:
enabled: true
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index bbcd25a..cb8eff2 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -399,7 +399,12 @@
my $num_patches = @patches;
for my $hash (@patches) {
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";
while (<$FILE>) {
chomp;