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 - Push code only with the user's authorization. A remote does not give
44 - Rebase before an authorized push only when the task permits it. Do not
45 rewrite published commits without the user's explicit approval. Stop
46 and ask when an operation needs that approval. Never make a merge
51 - Use 50 characters or fewer.
52 - Write a short summary in the present-tense imperative mood.
53 - Capitalize the first word. Do not end with a period.
54 - Do not use a subsystem or prefix.
58 - Separate the subject from the body with exactly one blank line.
59 - Always write a body. Wrap each line at 72 characters. Fill each line
60 of a paragraph before you wrap it. `bin/reflow` formats source
61 comments at 80 columns, not commit prose. Do not use it to format a
63 - Write in the present-tense declarative mood.
64 - Start with a direct summary of the complete change. Do not only repeat
66 - Explain what the change does and why it is necessary. Describe the
67 resulting behavior and design.
68 - Do not describe the development process, list the changed files, or
69 give obvious implementation steps.
73 - When the change belongs to an issue, end the message with one `Issue:`
74 trailer. Use the shortest unique git-bug issue ID in the `Issue:`
75 trailer, with a minimum of seven characters. Check uniqueness against
76 all issues, not only open issues. Assemble it with
77 `git interpret-trailers --trailer` before the message check. Never use
78 a closing keyword such as "Fixes" or "Closes".
79 - Link the bug report when a change fixes a reported bug.
80 - Include a stable archive URL when a change comes from a mailing-list
82 - Do not add an AI tool as co-author. Do not add attribution trailers.
87 Print the program name
89 OneChat prints its name and exits. The program gives the Nix package a
90 binary that the install check can run, so the build pipeline is tested
91 before the first feature.