dotfiles

Obligatory dotfiles repo
git clone git://git.danielmoch.com/dotfiles.git
Log | Files | Refs

commit 8393f91e4eb3f88ad9f8f2029e35f3939ea77ec3
parent e6093ab45c7891e21f0057ef0c39fb53fbd31a68
Author: Daniel Moch <daniel@danielmoch.com>
Date:   Tue,  1 Oct 2019 20:16:53 -0400

Fix pre-commit for POSIX userspaces

Diffstat:
M.local/lib/gitdir/hooks/pre-commit | 10+---------
1 file changed, 1 insertion(+), 9 deletions(-)

diff --git a/.local/lib/gitdir/hooks/pre-commit b/.local/lib/gitdir/hooks/pre-commit @@ -25,11 +25,8 @@ exec 1>&2 # them from being added to the repository. We exploit the fact that the # printable range starts at the space character and ends with tilde. if [ "$allownonascii" != "true" ] && - # Note that the use of brackets around a tr range is ok here, (it's - # even required, for portability to Solaris 10's /usr/bin/tr), since - # the square bracket bytes happen to fall in the designated range. test $(git diff --cached --name-only --diff-filter=A -z $against | - LC_ALL=C tr -d '[ -~]\0' | wc -c) != 0 + grep -e '^\x00-0x7F' | wc -c) != 0 then cat <<\EOF Error: Attempt to add a non-ASCII file name. @@ -45,10 +42,5 @@ EOF exit 1 fi -if [ -f go.mod -o -f main.go ] -then - go fmt -fi - # If there are whitespace errors, print the offending file names and fail. exec git diff-index --check --cached $against --