From 892aead383f71ef6d39542d733ba52a7702eb3fc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20M=C3=BCller?= Date: Sun, 6 Sep 2026 00:26:22 +0200 Subject: [PATCH] :bug: Fix commit template setup with git config Copying the template into .git/COMMIT_EDITMSG has no lasting effect: git pre-fills that file from the commit.template config, so the script registered nothing and the template never appeared. Use git's own mechanism, which is what git reads for every interactive commit. Name, prefix and call site are unchanged, so README's setup bullet stays correct; only the sentence describing the old copy in CONTRIBUTING needed rewording. Note the config holds a path relative to the working directory, so it applies to commits made from the repo root. --- CONTRIBUTING.md | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 8c3acbd..d2a14cb 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -14,7 +14,7 @@ CI and review will bounce these even though `npm run check` and the linters don' ## Commit messages -Gitmoji subject, imperative mood, 50/72 wrapping. The template is `commit-message-template`; `npm run use:git-commit-message` installs it into `.git/COMMIT_EDITMSG`. +Gitmoji subject, imperative mood, 50/72 wrapping. The template is `commit-message-template`; run `npm run use:git-commit-message` once after cloning to register it as git's `commit.template`. Examples from history: `:sparkles: Add watch tier with watch:test child`, `:recycle: Move type-aware config to .oxlintrc.json; use source-level disable directives`, `:memo: Restore unique maintainer content as CONTRIBUTING.md`. The body explains _what and why_, not _how_; link issues with `Resolves #...`. diff --git a/package.json b/package.json index f789c66..89502ca 100644 --- a/package.json +++ b/package.json @@ -55,7 +55,7 @@ "watch:test": "node --test --watch --strip-types \"src/**/*.test.ts\"", "publish:attw": "attw . --pack --profile esm-only", "publish:publint": "publint", - "use:git-commit-message": "cp commit-message-template .git/COMMIT_EDITMSG || true" + "use:git-commit-message": "git config commit.template commit-message-template" }, "devDependencies": { "@arethetypeswrong/cli": "^0.18.5",