git: Remove pre-commit hook (#1659)

The README no longer contains version information and we are moving away
from using scripts and tooling to update the version string in various
places, see #1540
This commit is contained in:
Patrick Ziegler 2019-02-23 08:55:30 +01:00 committed by GitHub
parent e1e27dfcad
commit 7d4e62f6d3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1,27 +0,0 @@
#!/bin/sh
# Pass if the README.md isn't staged for commit
test "$(git diff --staged README.md)" || exit 0
# Redirect all output to stderr
exec 1>&2
# shellcheck disable=SC2016
tag_prev=$(git tag -l | tail -2 | head -1)
tag_curr=$(git tag -l | tail -1)
# Pass if tags aren't defined
[ "$tag_prev" ] || exit 0
[ "$tag_curr" ] || exit 0
sed -n "/${tag_prev}/q1" README.md
# Pass if the previous tag wasn't found
[ $? -eq 1 ] || exit 0
echo
echo "\033[36;1mNOTICE \033[37;1m**\033[0m Updating README.md with latest tag (\033[1m${tag_prev}\033[0m => \033[1m${tag_curr}\033[0m)"
echo " The change will be staged for commit..."
echo
sed -i "s/${tag_prev}/${tag_curr}/g" README.md