3 description: Commit procedure and message rules. Use for every commit.
8 The procedure applies to normal repository commits, including code and
9 documentation commits. Each must use the configured signing key.
10 Internal git-bug commits for issues, comments, status changes, and other
11 tracker metadata are exempt from signing and may be unsigned. This
12 exception does not permit unsigned code or documentation commits.
16 1. Confirm that the configured signing key is available. If signing is
17 unavailable or fails, stop and report the problem. Never disable
18 signing, bypass it with a command or configuration override, or
19 create an unsigned normal repository commit.
20 2. Do the `check` skill. All checks must pass before you commit.
21 3. Stage only the files that belong to this change. Keep unrelated
22 changes in separate commits.
23 4. Write the complete message to a file, including all trailers. Add
24 trailers with `git interpret-trailers --trailer` before the check,
25 not after it. Never put `\n` in `git commit -m`.
26 5. Run `sh .githooks/commit-msg MESSAGE_FILE` on that final file before
27 `git commit`. Fix every failure and run the check again. Sign with
28 the configured key, using `git commit -S -F MESSAGE_FILE` on the same
29 file. Do not add or change trailers after the check. The normal
30 commit hook still runs. Never skip it with `--no-verify`.
31 6. Cryptographically verify each new normal commit's signature against
32 the configured key before reporting completion. A signature header
33 alone is not verification. If `gpg.ssh.allowedSignersFile` is not
34 set, use a temporary allowed-signers file with the configured key. Do
35 not change the Git configuration. If verification fails, stop and
36 report it. Do not claim completion or publish the commit.
40 - Commit often. Split the work into small, coherent, working steps, and
41 do not wait for a full feature.
42 - Use fixup commits for review corrections when the task requires them.
43 Report the corrections and the pending fixups, but do not report the
44 work as complete while `fixup!` or `squash!` commits remain.
45 - Before autosquashing, obtain the user's explicit approval to rewrite
46 the affected commit range. Permission to create a fixup does not
47 authorize a history rewrite. If approval is absent, stop and ask.
48 - After an approved autosquash, sign and verify each rewritten normal
49 commit, rerun the required checks, and obtain independent review of
50 the final range before reporting completion.
51 - Push code only with the user's authorization. A remote does not give
53 - Rebase before an authorized push only when the task permits it. Do not
54 rewrite published commits without the user's explicit approval. Stop
55 and ask when an operation needs that approval. Never make a merge
60 - Use 50 characters or fewer.
61 - Write a short summary in the present-tense imperative mood.
62 - Capitalize the first word. Do not end with a period.
63 - Do not use a subsystem or prefix.
67 - Separate the subject from the body with exactly one blank line.
68 - Always write a body. Wrap each line at 72 characters. Fill each line
69 of a paragraph before you wrap it. `bin/reflow` formats source
70 comments at 80 columns, not commit prose. Do not use it to format a
72 - Write in the present-tense declarative mood.
73 - Start with a direct summary of the complete change. Do not only repeat
75 - Explain what the change does and why it is necessary. Describe the
76 resulting behavior and design.
77 - Do not describe the development process, list the changed files, or
78 give obvious implementation steps.
82 - When the change belongs to an issue, end the message with one `Issue:`
83 trailer. Use the shortest unique git-bug issue ID in the `Issue:`
84 trailer, with a minimum of seven characters. Check uniqueness against
85 all issues, not only open issues. Assemble it with
86 `git interpret-trailers --trailer` before the message check. Never use
87 a closing keyword such as "Fixes" or "Closes".
88 - Link the bug report when a change fixes a reported bug.
89 - Include a stable archive URL when a change comes from a mailing-list
91 - Do not add an AI tool as co-author. Do not add attribution trailers.
96 Print the program name
98 OneChat prints its name and exits. The program gives the Nix package a
99 binary that the install check can run, so the build pipeline is tested
100 before the first feature.