summaryrefslogtreecommitdiff
path: root/Makefile.am
diff options
context:
space:
mode:
authorMaxim Cournoyer <maxim@guixotic.coop>2026-05-29 11:45:34 +0900
committerMaxim Cournoyer <maxim@guixotic.coop>2026-05-29 11:52:12 +0900
commitdc64ec527c2f5056d28cfef246769e68dcedea2a (patch)
tree26f33d1d6c1ba8cdf3b42261e41b85ecb6a3a137 /Makefile.am
parent9873d2c433b7dc8e2d510fc437c5b13c98d0a4ff (diff)
build: Ensure the installed pre-push git hook matches its source.
* Makefile.am ($(GIT_HOOKS_DIR)/pre-push): Make a phony target, and copy file when the target differs from its prerequisite. Fixes: #7645 Reported-by: Gábor Udvari <mail@gaborudvari.com> Change-Id: I6b5f677afe59c25a4d8905da814af4bbd91fb401
Diffstat (limited to 'Makefile.am')
-rw-r--r--Makefile.am8
1 files changed, 8 insertions, 0 deletions
diff --git a/Makefile.am b/Makefile.am
index 79575c7dfdb..d349fcaa383 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1281,6 +1281,14 @@ $(GIT_HOOKS_DIR):
1281$(GIT_HOOKS_DIR)/%: etc/git/% | $(GIT_HOOKS_DIR)/ 1281$(GIT_HOOKS_DIR)/%: etc/git/% | $(GIT_HOOKS_DIR)/
1282 if [ -n "$(GIT_HOOKS_DIR)" ]; then cp "$<" "$@"; fi 1282 if [ -n "$(GIT_HOOKS_DIR)" ]; then cp "$<" "$@"; fi
1283 1283
1284# Special-case the pre-push hook installation, to ensure it is always
1285# up-to-date with its source.
1286.PHONY: $(GIT_HOOKS_DIR)/pre-push
1287$(GIT_HOOKS_DIR)/pre-push: etc/git/pre-push | $(GIT_HOOKS_DIR)
1288 @if [ -n "$(GIT_HOOKS_DIR)" ]; then \
1289 cmp "--silent" "$<" "$@" || cp "$<" "$@"; \
1290 fi
1291
1284$(GIT_CONFIG_FILE): etc/git/gitconfig 1292$(GIT_CONFIG_FILE): etc/git/gitconfig
1285 if [ -n "$(GIT_CONFIG_FILE)" ]; then \ 1293 if [ -n "$(GIT_CONFIG_FILE)" ]; then \
1286 git config --fixed-value --replace-all include.path \ 1294 git config --fixed-value --replace-all include.path \