From d8d60fa62f0e5ecd82b233763c3290cf246a9c89 Mon Sep 17 00:00:00 2001 From: Matthias Beyer Date: Fri, 26 Oct 2018 16:38:14 +0200 Subject: Move hook to have right file name Signed-off-by: Matthias Beyer --- scripts/hooks/commit-msg.signoffby-missing-warn.sh | 17 +++++++++++++++++ scripts/hooks/pre-commit.signoffby-missing-warn.sh | 17 ----------------- 2 files changed, 17 insertions(+), 17 deletions(-) create mode 100644 scripts/hooks/commit-msg.signoffby-missing-warn.sh delete mode 100644 scripts/hooks/pre-commit.signoffby-missing-warn.sh (limited to 'scripts') diff --git a/scripts/hooks/commit-msg.signoffby-missing-warn.sh b/scripts/hooks/commit-msg.signoffby-missing-warn.sh new file mode 100644 index 00000000..470e6575 --- /dev/null +++ b/scripts/hooks/commit-msg.signoffby-missing-warn.sh @@ -0,0 +1,17 @@ +#!/usr/bin/env bash + +# +# The following snippet can be used to _WARN_ if a Signed-off-by line is missing +# in the commit message +# + +RED='\e[0;31m' # Red +NORMAL='\e[0m' # Text Reset + +if [ "1" != "$(grep -c '^Signed-off-by: ' "$1")" ]; then + printf >&2 "%sMissing Signed-off-by line.%s\n" "$RED" "$NORMAL" + + # To not only warn, but abort the commit, uncomment the next line + # exit 1 +fi + diff --git a/scripts/hooks/pre-commit.signoffby-missing-warn.sh b/scripts/hooks/pre-commit.signoffby-missing-warn.sh deleted file mode 100644 index 470e6575..00000000 --- a/scripts/hooks/pre-commit.signoffby-missing-warn.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash - -# -# The following snippet can be used to _WARN_ if a Signed-off-by line is missing -# in the commit message -# - -RED='\e[0;31m' # Red -NORMAL='\e[0m' # Text Reset - -if [ "1" != "$(grep -c '^Signed-off-by: ' "$1")" ]; then - printf >&2 "%sMissing Signed-off-by line.%s\n" "$RED" "$NORMAL" - - # To not only warn, but abort the commit, uncomment the next line - # exit 1 -fi - -- cgit v1.2.3