mirror of
https://github.com/lingble/tegra-demo-distro.git
synced 2025-11-01 13:07:48 +00:00
To support the upcoming OE4T contributor guide wiki page, add a script which generates a pre-commit hook with Signed-off-by message appended. Signed-off-by: Dan Walkes <danwalkes@boulderai.com>
19 lines
593 B
Bash
Executable File
19 lines
593 B
Bash
Executable File
#!/bin/sh
|
|
set -e
|
|
BASEDIR=$(git rev-parse --show-toplevel)
|
|
SCRIPTDIR=$(dirname $0)
|
|
for GITHOOKDIR in ${BASEDIR}/.git/hooks ${BASEDIR}/.git/modules/repos/*/hooks
|
|
do
|
|
for GITHOOK in ${SCRIPTDIR}/git-scripts/*
|
|
do
|
|
GITHOOKFILE=$(basename $GITHOOK)
|
|
if [ -e ${GITHOOKDIR}/${GITHOOKFILE} ]; then
|
|
echo "A git hook file aleady exists at ${GITHOOKDIR}/${GITHOOKFILE}, leaving as-is"
|
|
else
|
|
echo "Adding ${GITHOOKFILE} to ${GITHOOKDIR}"
|
|
cp ${GITHOOK} ${GITHOOKDIR}
|
|
chmod a+x ${GITHOOKDIR}/${GITHOOKFILE}
|
|
fi
|
|
done
|
|
done
|