🐛 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.
This commit is contained in:
1 parent
682ecf1163
commit
892aead383
2 files changed
+2
-2
No files matched your search
+1
-1
@@ -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 #...`.
|
||||
|
||||
|
||||
+1
-1
@@ -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",
|
||||
|
||||
Reference in new issue
Block a user