commit c47fd804ea9df0475094e39f9dd67d0760f59572
parent 52d4051a373857f182e05b86e18fde911c526f0f
Author: Alex Balgavy <a.balgavy@gmail.com>
Date: Mon, 10 Feb 2020 12:39:58 +0100
git: updated hooks to work with submodules
Former-commit-id: ee82d39580707080a7192dd525f4f317bb23b36c
Diffstat:
4 files changed, 18 insertions(+), 8 deletions(-)
diff --git a/git/git_template/hooks/post-checkout b/git/git_template/hooks/post-checkout
@@ -1,2 +1,4 @@
-#!/usr/bin/env bash
-.git/hooks/ctags >/dev/null 2>&1 &
+#!/bin/bash
+
+gitDir=$(git rev-parse --git-dir)
+$gitDir/hooks/ctags >/dev/null 2>&1 &
diff --git a/git/git_template/hooks/post-commit b/git/git_template/hooks/post-commit
@@ -1,2 +1,4 @@
-#!/usr/bin/env bash
-.git/hooks/ctags >/dev/null 2>&1 &
+#!/bin/bash
+
+gitDir=$(git rev-parse --git-dir)
+$gitDir/hooks/ctags >/dev/null 2>&1 &
diff --git a/git/git_template/hooks/post-merge b/git/git_template/hooks/post-merge
@@ -1,2 +1,4 @@
-#!/usr/bin/env bash
-.git/hooks/ctags >/dev/null 2>&1 &
+#!/bin/bash
+
+gitDir=$(git rev-parse --git-dir)
+$gitDir/hooks/ctags >/dev/null 2>&1 &
diff --git a/git/git_template/hooks/post-rewrite b/git/git_template/hooks/post-rewrite
@@ -1,4 +1,8 @@
-#!/usr/bin/env bash
+#!/bin/bash
+
case "$1" in
- rebase) exec .git/hooks/post-merge ;;
+rebase)
+ gitDir=$(git rev-parse --git-dir)
+ $gitDir/hooks/ctags >/dev/null 2>&1 &
+ ;;
esac