[UPD] convention : nommer les fichiers à l'indexation, pas git add -A

`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
This commit is contained in:
Mathieu Benoit 2026-08-30 04:43:26 -04:00
parent 78e702e1e3
commit 4701660203
2 changed files with 17 additions and 1 deletions

View file

@ -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

View file

@ -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