diff --git a/.claude/rules/04-code-conventions.md b/.claude/rules/04-code-conventions.md index 738f80d..a5943ba 100644 --- a/.claude/rules/04-code-conventions.md +++ b/.claude/rules/04-code-conventions.md @@ -88,6 +88,10 @@ liste, et elle est vraie demain. - Format de commit : `[TYPE] portée : sujet`, sujet à l'impératif, 72 caractères au plus. Tags réellement utilisés : `[UPD]`, `[FIX]`, `[ADD]`, `[IMP]`, `[REF]`. +- **Nommer les fichiers à l'indexation, jamais `git add -A`** : `private/` et + `tasks/` ne sont pas suivis EXPRÈS, et un ratissage les commit. Il emporte + aussi ce qui est en cours ailleurs dans le checkout, sous un sujet qui ne le + couvre pas. `git add -p` quand un fichier porte deux sujets. ### Le sujet diff --git a/conf/template_claude_commands_commit.md b/conf/template_claude_commands_commit.md index 0fec838..49633e8 100644 --- a/conf/template_claude_commands_commit.md +++ b/conf/template_claude_commands_commit.md @@ -244,8 +244,20 @@ configured `user.email` then fails on the committer. Use a heredoc rather than `-m`: a body with quotes, backticks or accented characters survives it unharmed. +**Name the files. Never `git add -A`.** It stages everything untracked, and +this repository keeps two directories untracked ON PURPOSE: `private/`, the +only place allowed to hold customer data, and `tasks/`, where the convention +sends the investigation precisely because it is not versioned. A sweep commits +both. It also swallows whatever else is in flight in the checkout — another +tool's output, a half-finished edit — under a subject that does not cover it. + +`git status --porcelain` lists what changed; stage the paths that belong to +the subject you just wrote, and no others. When one file carries two subjects, +`git add -p` stages the hunks that belong to this commit. + ```bash -git add -A +git status --porcelain +git add script/module/thing.py test/test_thing.py git -c user.name="Your Name" -c user.email="your@email.com" commit -F - <<'MSG' [TAG] scope: description