From 2ff9fc13a1e4e9424659fb50765efcc7a8100a37 Mon Sep 17 00:00:00 2001 From: Vassil Vassilev Date: Mon, 1 Apr 2024 09:30:25 +0000 Subject: [PATCH] [ci] Explain how to apply clang-format on multiple commits --- .github/workflows/clang-format.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/clang-format.yml b/.github/workflows/clang-format.yml index 827cc6436..4350eaa74 100644 --- a/.github/workflows/clang-format.yml +++ b/.github/workflows/clang-format.yml @@ -43,4 +43,8 @@ jobs: -c color.diff.whitespace='red reverse' \ clang-format-15 --diff --binary clang-format-15 --commit $PR_BASE -- demos/ include/ lib/ tools/ || \ (echo "Please run the following git-clang-format locally to fix the formatting: \n - git clang-format origin/master -- demos/ include/ lib/ tools/" && exit 1) + git-clang-format HEAD~\n + for multiple commits we should place the formatting changes in the related commit with:\n + \t\tgit rebase -i -x \"git-clang-format-15 master && git commit -a --allow-empty --fixup=HEAD\" --strategy-option=theirs origin/master\n + \t\t Then inspect the results with: git log --oneline\n + \t\t Then squash without poluting the history with: git rebase --autosquash -i master\n" && exit 1)