From 4701660203158bba5a06f65ab1c84b4d42ce1d5f Mon Sep 17 00:00:00 2001 From: Mathieu Benoit Date: Sun, 30 Aug 2026 04:43:26 -0400 Subject: [PATCH] =?UTF-8?q?[UPD]=20convention=20:=20nommer=20les=20fichier?= =?UTF-8?q?s=20=C3=A0=20l'indexation,=20pas=20git=20add=20-A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `git add -A` indexe tout ce qui n'est pas suivi. Or `private/` et `tasks/` ne le sont pas EXPRÈS : le premier est le seul endroit autorisé à porter une donnée de client, le second reçoit l'enquête précisément parce qu'il ne part pas dans git. Un ratissage les commit tous les deux. Il emporte aussi ce qui est en cours ailleurs dans le checkout, sous un sujet qui ne le couvre pas. Le gabarit nomme désormais les fichiers et renvoie à `git add -p` quand un fichier porte deux sujets. La règle porte la même consigne : le gabarit ne se lit qu'à l'appel de la commande, la règle est chargée à chaque session. --- EN --- `git add -A` stages everything untracked. Yet `private/` and `tasks/` are untracked ON PURPOSE: the first is the only place allowed to carry customer data, the second receives the investigation precisely because it does not go into git. A sweep commits both. It also swallows whatever else is in flight in the checkout, under a subject that does not cover it. The template now names the files and points at `git add -p` when one file carries two subjects. The rule carries the same instruction: the template is read only when the command is invoked, the rule is loaded every session. Assisted-by: Claude Opus 5 --- .claude/rules/04-code-conventions.md | 4 ++++ conf/template_claude_commands_commit.md | 14 +++++++++++++- 2 files changed, 17 insertions(+), 1 deletion(-) 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