tg.sh: respect core.hooksPath mostly
commit7ba62a43abf422bbe46fe7601660ebefb63eb4a6
authorKyle J. McKay <mackyle@gmail.com>
Thu, 9 Feb 2017 08:06:27 +0000 (9 00:06 -0800)
committerKyle J. McKay <mackyle@gmail.com>
Thu, 9 Feb 2017 08:06:27 +0000 (9 00:06 -0800)
tree520f8135fdbb7460543e283f8b5aaed07bd462d5
parentd8235d547f3598c254f20baab411bfff01a830a8
tg.sh: respect core.hooksPath mostly

Git version 2.9 introduced the core.hooksPath configuration
option.  However, the interpretation of non-absolute paths is
terribly ill-conceived.

If Git is at least version 2.9 and core.hooksPath is set to an
absolute path, assume that's the correct location of the hooks
directory instead of $(git rev-parse --git-common-dir)/hooks.

The $(git rev-parse --git-path hooks) command does not work
properly with core.hooksPath until Git 2.10 so it's not used and
it's unclear what its semantics with a relative hooksPath would be
anyway so it's best avoided.

Signed-off-by: Kyle J. McKay <mackyle@gmail.com>
tg.sh