diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-27 18:24:20 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-27 18:24:20 +0000 |
commit | 483eb2f56657e8e7f419ab1a4fab8dce9ade8609 (patch) | |
tree | e5d88d25d870d5dedacb6bbdbe2a966086a0a5cf /src/spdk/.githooks/pre-commit | |
parent | Initial commit. (diff) | |
download | ceph-upstream.tar.xz ceph-upstream.zip |
Adding upstream version 14.2.21.upstream/14.2.21upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/spdk/.githooks/pre-commit')
-rwxr-xr-x | src/spdk/.githooks/pre-commit | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/src/spdk/.githooks/pre-commit b/src/spdk/.githooks/pre-commit new file mode 100755 index 00000000..c0b46124 --- /dev/null +++ b/src/spdk/.githooks/pre-commit @@ -0,0 +1,28 @@ +#!/bin/sh +# +# Verify what is about to be committed. +# Called by "git commit" with no arguments. The hook should +# exit with non-zero status after issuing an appropriate message if +# it wants to stop the commit. + +rc=0 + +# Redirect output to stderr. +exec 1>&2 + +# If there are formatting errors, print the offending file names and fail. +if [ -x "./scripts/check_format.sh" ]; then + echo "Running check_format.sh ..." + "./scripts/check_format.sh" > check_format.log 2>&1 + rc=$? + if [ $rc -ne 0 ]; then + cat check_format.log + echo "" + echo "ERROR check_format.sh returned errors!" + echo "ERROR Fix the problem and use 'git add' to update your changes." + echo "ERROR See `pwd`/check_format.log for more information." + echo "" + fi +fi + +exit $rc |