From 9d19b6b2f94b16c88ef169713c277fab82392175 Mon Sep 17 00:00:00 2001 From: Mamtha Soni K Date: Tue, 17 Jan 2017 07:39:25 +0530 Subject: [PATCH] Issue ekstep/Daily-Report-from-GIT#2 feat:Adding commit message hooks --- setup-hooks.bat | 10 ++++++++++ setup-hooks.sh | 14 ++++++++++++++ 2 files changed, 24 insertions(+) create mode 100755 setup-hooks.bat create mode 100755 setup-hooks.sh diff --git a/setup-hooks.bat b/setup-hooks.bat new file mode 100755 index 0000000..b3055a5 --- /dev/null +++ b/setup-hooks.bat @@ -0,0 +1,10 @@ +@echo off + +echo Copy hooks to .git repo +IF EXIST "hooks\" ( +call git subtree pull --prefix=hooks\ --squash hooks master +) ELSE ( +call git remote add hooks https://github.com/ekstep/GitHooks.git +call git subtree add --prefix=hooks\ --squash hooks master +) +xcopy "hooks\prepare-commit-msg" ".git\hooks\" /y diff --git a/setup-hooks.sh b/setup-hooks.sh new file mode 100755 index 0000000..c20c15b --- /dev/null +++ b/setup-hooks.sh @@ -0,0 +1,14 @@ +#!/bin/sh +# This script is for setting up git hooks + +#Copies the hooks to the .git directory + +if [ ! -d "hooks" ]; then +git remote add hooks https://github.com/ekstep/GitHooks.git +git subtree add --prefix=hooks/ --squash hooks master +else +git subtree pull --prefix=hooks/ --squash hooks master +fi +cp hooks/prepare-commit-msg .git/hooks/prepare-commit-msg + +exit 1;