diff --git a/home/claude/memory/git_conventions.md b/home/claude/memory/git_conventions.md index 9ce660c..1a8c540 100644 --- a/home/claude/memory/git_conventions.md +++ b/home/claude/memory/git_conventions.md @@ -23,16 +23,18 @@ If none of those yield an ID, ask which ticket to file the work under. Do not gu **Exception — repos with no issue tracker.** Personal repos such as `nixfiles` have no Jira project. There the scope is the area of the change, not a ticket: `chore(claude): ...`, `chore(deps): ...`, `feat(hosts): ...`. Conventional form is still required; only the ticket scope is dropped. Never invent a WSP number to satisfy the rule in a repo that has no tickets. The ticket requirement applies to the work repos under `~/code` that are backed by the WSP Jira project and gated by CI. -**This format is mandatory and overrides the repo's existing log style.** Many repos (`multicluster`, `core-services-cloud`) have histories full of bare `: summary` subjects written by other people. Do not copy that. Match repo style for *branch names* only; commit subjects are always full Conventional Commits with the ticket scope. CI enforces this, and a failure means Lyra rebases the history by hand. +**This format is mandatory and overrides the repo's existing log style.** Many repos (`multicluster`, `core-services-cloud`) have histories full of bare `: summary` subjects written by other people. Do not copy that. Match repo style for _branch names_ only; commit subjects are always full Conventional Commits with the ticket scope. CI enforces this, and a failure means Lyra rebases the history by hand. **Known failure mode — scope decay across a session.** The first commit gets `fix(): ...` correctly, then follow-up commits in the same sitting degrade to bare `test: add tests for class`, `refactor: hoist middleware`, `chore: tidy`. This has caused real rebase work in `core-services-cloud`. The second, third and fifth commits need the ticket scope exactly as much as the first. Re-read the subject against the format before every single `git commit`. **Merge commits count too.** Prefer `git rebase origin/` over `git merge` so none is created. If unavoidable, set the message explicitly: `git merge --no-ff -m ": merge master into "`. Keep the ID uppercase; the check is case-sensitive. **Before pushing, verify — do not skip this:** + ``` git log --format=%s origin/..HEAD | grep -vE '^[a-z]+(\([A-Z]{2,}-[0-9]+\))!?: ' ``` + Must print nothing. Writing each subject carefully is not a substitute for running it. **Auditing past behaviour is unreliable.** If Lyra has already rebased to fix a bad subject, the log shows her corrected version, not what was originally written. A clean `git log` is not evidence that nothing was wrong. Check author date vs committer date (`--format="%ad %cd"`) — a mismatch means history was rewritten. Never argue from a clean log that the fault did not occur.