From adbe85b7c1f02626cff56a475a1de072fbec19a9 Mon Sep 17 00:00:00 2001 From: James Patrick Date: Mon, 15 Apr 2019 20:00:14 -0400 Subject: [PATCH] Added post-merge hook to run update on merge. This will case `make update` to run everytime there is a successful merge. This will include everytime the is a non no-op merge. This *will not run* if: 1. There is no changes. 2. There is a conflict in the merge. Additionally the make install set will now sym link the post-merge hook. --- bin/post-merge | 8 ++++++++ makefile | 1 + 2 files changed, 9 insertions(+) create mode 100755 bin/post-merge diff --git a/bin/post-merge b/bin/post-merge new file mode 100755 index 0000000..075e5b4 --- /dev/null +++ b/bin/post-merge @@ -0,0 +1,8 @@ +#!/bin/sh + +local_hook="$HOME"/.git_template.local/hooks/post-merge +[ -f "$local_hook" ] && . "$local_hook" + +.git/hooks/ctags >/dev/null 2>&1 & + +make update diff --git a/makefile b/makefile index 99c0204..dc277e4 100644 --- a/makefile +++ b/makefile @@ -5,6 +5,7 @@ cmd_exist = $(shell (command -v $(1) 1>&2 >/dev/null && echo true || echo false) install: | init update init: vim_init tmux_init + @ ln -svf $(SRC_DIR)/bin/post-merge $(SRC_DIR)/.git/hooks/post-merge update: vim_update tmux_init: