[Secure-testing-commits] r59028 - bin conf
Salvatore Bonaccorso
carnil at moszumanska.debian.org
Fri Dec 29 19:17:02 UTC 2017
Author: carnil
Date: 2017-12-29 19:17:02 +0000 (Fri, 29 Dec 2017)
New Revision: 59028
Added:
bin/setup-repo
conf/pre-commit
Log:
Add pre-commit hook to check syntax
Added: bin/setup-repo
===================================================================
--- bin/setup-repo (rev 0)
+++ bin/setup-repo 2017-12-29 19:17:02 UTC (rev 59028)
@@ -0,0 +1,31 @@
+#!/bin/sh
+#
+# Set up a clone of the security-tracker git repo
+
+set -e
+
+SRC=../../conf/pre-commit
+HOOK=.git/hooks/pre-commit
+
+install_pre_commit_hook() {
+ if [ -L "${HOOK}" ] && [ "$(readlink ${HOOK})" = "${SRC}" ]; then
+ echo "pre-commit hook already set up"
+ return
+ fi
+
+ if [ -e "${HOOK}" ] || [ -L "${HOOK}" ]; then
+ echo "Moving old pre-commit hook"
+ mv -f "${HOOK}" "${HOOK}.$(date '+%s')"
+ fi
+
+ echo "Installing pre-commit hook"
+ ln -s "${SRC}" "${HOOK}"
+}
+
+
+if [ "$(git rev-parse --show-cdup)" != '' ] || [ -d data/CVE/list ]; then
+ echo "This does not look like the git repo of the security tracker" 1>&2
+ exit 1
+fi
+
+install_pre_commit_hook
Property changes on: bin/setup-repo
___________________________________________________________________
Added: svn:executable
+ *
Added: conf/pre-commit
===================================================================
--- conf/pre-commit (rev 0)
+++ conf/pre-commit 2017-12-29 19:17:02 UTC (rev 59028)
@@ -0,0 +1,12 @@
+#!/bin/sh
+
+set -e
+
+if [ -z "${GIT_DIR}" ]; then
+ echo "GIT_DIR not set" 1>&2
+ exit 1
+fi
+
+exec 1>&2
+
+make check-syntax
Property changes on: conf/pre-commit
___________________________________________________________________
Added: svn:executable
+ *
More information about the Secure-testing-commits
mailing list