[#1689] Makefile: Create prepare-commit-msg hook too
All checks were successful
Vulncheck / Vulncheck (push) Successful in 1m17s
Pre-commit hooks / Pre-commit (push) Successful in 1m31s
Build / Build Components (push) Successful in 2m9s
Tests and linters / gopls check (push) Successful in 3m45s
OCI image / Build container images (push) Successful in 4m26s
Tests and linters / Run gofumpt (push) Successful in 5m5s
Tests and linters / Tests (push) Successful in 5m16s
Tests and linters / Staticcheck (push) Successful in 5m39s
Tests and linters / Lint (push) Successful in 5m42s
Tests and linters / Tests with -race (push) Successful in 5m46s

`commit-msg` is ignored when `--no-verify` option is used, so there is
no way to ignore `pre-commit` while retaining `commit-msg` hook.
Ignoring pre-commit is useful, though, so we might add Change-Id in
`prepare-commit-msg` hook instead. It accepts more parameters, but the
first one is a file with the commit message, so we may reuse
`commit-msg` hook.

Change-Id: I4edb79810bbe38a5dcf7f4f07535f34c6bda0da3
Signed-off-by: Evgenii Stratonikov <e.stratonikov@yadro.com>
This commit is contained in:
Evgenii Stratonikov 2025-03-20 17:26:35 +03:00
parent affab25512
commit 7df2912a83
Signed by: fyrchik
SSH key fingerprint: SHA256:m/TTwCzjnRkXgnzEx9X92ccxy1CcVeinOgDb3NPWWmg

View file

@ -194,6 +194,8 @@ review-install:
@mkdir -p $(GIT_HOOK_DIR)/
@curl -Lo $(GIT_HOOK_DIR)/commit-msg https://review.frostfs.info/tools/hooks/commit-msg
@chmod +x $(GIT_HOOK_DIR)/commit-msg
@echo -e '#!/bin/sh\n"$$(git rev-parse --git-path hooks)"/commit-msg "$$1"' >$(GIT_HOOK_DIR)/prepare-commit-msg
@chmod +x $(GIT_HOOK_DIR)/prepare-commit-msg
# Create a PR in Gerrit
review: BRANCH ?= master