Spdk/.githooks/pre-commit
Michal Berger 588dfe314b Add SPDX header to various files
They were missed by the initial set of patches which introduced this
header as a mandatory one across different types of files.

Signed-off-by: Michal Berger <michal.berger@intel.com>
Change-Id: I3f9b37d41298c843e1648e72fe8593768ccd37e0
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/15423
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2022-11-29 08:27:51 +00:00

32 lines
809 B
Bash
Executable File

#!/bin/sh
# SPDX-License-Identifier: BSD-3-Clause
# All rights reserved.
#
# 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