]> 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>
Thu, 28 Oct 2021 14:45:14 +0000 (16:45 +0200)
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.

.gitlab-ci.yml

index d11ff416faf07ffb4af29b33b06e7ff925edf564..8e8f056441e1f9c373105b07a14b84044eed6561 100644 (file)
@@ -446,7 +446,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