aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Eggert2022-02-23 11:29:56 -0800
committerRobert Pluim2022-03-01 10:01:11 +0100
commitb8bc359bbfd36b3e281bdcba154ed74ca897d850 (patch)
tree09876afaf12d5035f2925de3988ddcb2e434393f
parent6dbc3da2055610109c8e481e53f0b0287b201e58 (diff)
downloademacs-b8bc359bbfd36b3e281bdcba154ed74ca897d850.tar.gz
emacs-b8bc359bbfd36b3e281bdcba154ed74ca897d850.zip
Backport: Port pre-commit hook to Git 2.35.0
* build-aux/git-hooks/pre-commit: Use LC_ALL=C grep -E instead of sane_egrep (removed in Git 2.35.0). (cherry picked from commit b8a96f055624f86fe965a0d1b7b2495b2db80e63)
-rwxr-xr-xbuild-aux/git-hooks/pre-commit4
1 files changed, 3 insertions, 1 deletions
diff --git a/build-aux/git-hooks/pre-commit b/build-aux/git-hooks/pre-commit
index a55004680fa..49bf05f2d9f 100755
--- a/build-aux/git-hooks/pre-commit
+++ b/build-aux/git-hooks/pre-commit
@@ -45,7 +45,9 @@ git_diff='git diff --cached --name-only --diff-filter=A'
45 45
46# 'git diff' will backslash escape tabs and newlines, so we don't have 46# 'git diff' will backslash escape tabs and newlines, so we don't have
47# to worry about word splitting here. 47# to worry about word splitting here.
48$git_diff $head | sane_egrep 'ChangeLog|^-|/-|[^-+./_0-9A-Z_a-z]' | while IFS= read -r new_name; do 48$git_diff $head |
49LC_ALL=C grep -E 'ChangeLog|^-|/-|[^-+./_0-9A-Z_a-z]' |
50while IFS= read -r new_name; do
49 case $new_name in 51 case $new_name in
50 -* | */-*) 52 -* | */-*)
51 echo "$new_name: File name component begins with '-'." 53 echo "$new_name: File name component begins with '-'."