Files
tegra-demo-distro/scripts-setup/git-scripts/prepare-commit-msg
Dan Walkes e6bd1d9aaf scripts-setup: Add example pre commit hook
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>
2020-11-17 03:57:07 -08:00

16 lines
341 B
Plaintext
Executable File

#/bin/sh
NAME=$(git config user.name)
EMAIL=$(git config user.email)
if [ -z "$NAME" ]; then
echo "empty git config user.name"
exit 1
fi
if [ -z "$EMAIL" ]; then
echo "empty git config user.email"
exit 1
fi
git interpret-trailers --if-exists doNothing --trailer \
"Signed-off-by: $NAME <$EMAIL>" \
--in-place "$1"