scripts/checkpatch: roll diff tweaking into checkpatch itself
authorAlex Bennée <alex.bennee@linaro.org>
Wed, 23 Jun 2021 10:27:44 +0000 (11:27 +0100)
committerAlex Bennée <alex.bennee@linaro.org>
Fri, 25 Jun 2021 09:08:33 +0000 (10:08 +0100)
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>

.gitlab-ci.d/static_checks.yml
.patchew.yml
scripts/checkpatch.pl

index 7e685c6a65ef032c3c070f5397d462ab4ee978e1..c5fa4fce26dc2d935da147b195de07b5a97c12eb 100644 (file)
@@ -4,9 +4,6 @@ check-patch:
   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
index 2638b7f5649f6026dca59005fb6e78a0042dad6c..1b78262ce58dcd1f660bb68dd394b9e3072206a8 100644 (file)
@@ -138,9 +138,6 @@ testing:
       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
index bbcd25ae05775b17d1521ed9222a495b447a102e..cb8eff233e0656e8d64344e2325467cb8671f114 100755 (executable)
@@ -399,7 +399,12 @@ if ($chk_branch) {
        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;