]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
retain diff output if clang-format changes something
authorPetr Špaček <pspacek@isc.org>
Thu, 28 Oct 2021 14:39:20 +0000 (16:39 +0200)
committerPetr Špaček <pspacek@isc.org>
Tue, 2 Nov 2021 14:52:46 +0000 (15:52 +0100)
It's major PITA trying to guess what exactly clang-format has changed,
so how CI stores patch file with changes which can be applied locally if
needed.

(cherry picked from commit ca4393fc9fe85d2e6b7012ebe6684d972d6e6c8f)

.gitlab-ci.yml

index 9b52fdb3aba426369af6dc45d38347575356b066..a34e3f64ad7157a8464f86e6725d55bd020d419e 100644 (file)
@@ -470,7 +470,13 @@ clang-format:
   needs: []
   script:
     - if [ -r .clang-format ]; then "${CLANG_FORMAT}" -i -style=file $(git ls-files '*.c' '*.h'); fi
+    - git diff > clang-format.patch
     - if test "$(git status --porcelain | grep -Ev '\?\?' | wc -l)" -gt "0"; then git status --short; exit 1; fi
+  artifacts:
+    paths:
+      - clang-format.patch
+    expire_in: "1 week"
+    when: on_failure
 
 coccinelle:
   <<: *precheck_job