Skip to content

Commit bb56068

Browse files
committed
check-whitespace: avoid alerts about upstream commits
Every once in a while, whitespace errors are introduced in Git for Windows' rebases to newer Git versions, simply by virtue of integrating upstream commits that do not follow upstream Git's own whitespace rule. In Git v2.50.0-rc0, for example, 03f2915 (xdiff: disable cleanup_records heuristic with --minimal, 2025-04-29) introduced a trailing space. Arguably, non-actionable alerts are worse than no alerts at all, so let's suppress those alerts that we cannot do anything about, anyway. Signed-off-by: Johannes Schindelin <[email protected]>
1 parent 5a96bd1 commit bb56068

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

ci/check-whitespace.sh

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ problems=()
1919
commit=
2020
commitText=
2121
commitTextmd=
22+
committerEmail=
2223
goodParent=
2324

2425
if ! git rev-parse --quiet --verify "${baseCommit}"
@@ -27,7 +28,7 @@ then
2728
exit 1
2829
fi
2930

30-
while read dash sha etc
31+
while read dash email sha etc
3132
do
3233
case "${dash}" in
3334
"---") # Line contains commit information.
@@ -40,10 +41,14 @@ do
4041
commit="${sha}"
4142
commitText="${sha} ${etc}"
4243
commitTextmd="[${sha}](${url}/commit/${sha}) ${etc}"
44+
committerEmail="${email}"
4345
;;
4446
"")
4547
;;
4648
*) # Line contains whitespace error information for current commit.
49+
# Quod licet Iovi non licet bovi
50+
test [email protected] != "$committerEmail" || break
51+
4752
if test -n "${goodParent}"
4853
then
4954
problems+=("1) --- ${commitTextmd}")
@@ -64,7 +69,7 @@ do
6469
echo "${dash} ${sha} ${etc}"
6570
;;
6671
esac
67-
done <<< "$(git log --check --pretty=format:"---% h% s" "${baseCommit}"..)"
72+
done <<< "$(git log --check --pretty=format:"---% ce% h% s" "${baseCommit}"..)"
6873

6974
if test ${#problems[*]} -gt 0
7075
then

0 commit comments

Comments
 (0)