Skip to content

Commit c36869c

Browse files
authored
Merge pull request #6011 from LibreSign/backport/6009/stable32
[stable32] docs: add Git & Commit Practices section to copilot instructions
2 parents ba61435 + 897d133 commit c36869c

1 file changed

Lines changed: 66 additions & 0 deletions

File tree

.github/copilot-instructions.md

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,72 @@ The second example is clear without comments because the method names describe e
170170
- Serial number validation is critical for CRL operations
171171
- Use `occ libresign:crl:*` commands for CRL operations
172172

173+
## Git & Commit Practices
174+
175+
LibreSign follows specific commit conventions. See the [official commit guidelines](https://docs.libresign.coop/developer_manual/getting-started/commits.html) for complete details.
176+
177+
### Conventional Commits
178+
**All commits must follow [Conventional Commits](https://www.conventionalcommits.org/) specification.**
179+
180+
**Commit format:**
181+
```
182+
<type>: <short description>
183+
184+
[optional body]
185+
186+
Signed-off-by: Your Name <[email protected]>
187+
```
188+
189+
**Common types:**
190+
- `feat`: New feature
191+
- `fix`: Bug fix
192+
- `docs`: Documentation changes
193+
- `test`: Adding or updating tests
194+
- `refactor`: Code refactoring
195+
- `chore`: Maintenance tasks
196+
197+
**Examples:**
198+
```bash
199+
# Feature
200+
git commit -s -m "feat: add CRL revocation endpoint"
201+
202+
# Bug fix with description
203+
git commit -s -m "fix: validate certificate chain order
204+
205+
Certificate chains with more than 3 certificates were failing
206+
validation due to incorrect ordering. The OrderCertificatesTrait
207+
now properly orders from end-entity to root.
208+
209+
Fixes #1234"
210+
211+
# Documentation
212+
git commit -s -m "docs: add donation links to GitHub Sponsors and Stripe"
213+
```
214+
215+
### DCO (Developer Certificate of Origin)
216+
**Always sign off commits** using `git commit -s` or `git commit --signoff`.
217+
218+
Every commit must include the `Signed-off-by` line to comply with the [DCO](https://developercertificate.org/).
219+
220+
### Atomic Commits Best Practices
221+
- One logical change per commit
222+
- Commit should be self-contained and functional
223+
- Tests should pass after each commit
224+
- Makes git bisect and code review more effective
225+
226+
**When to commit:**
227+
- After completing a logical unit of work
228+
- Before switching tasks or branches
229+
- After tests pass for the changes
230+
- At natural breakpoints in development
231+
232+
**Bad practices to avoid:**
233+
- Committing unrelated changes together
234+
- Generic messages like "fixes", "wip", "misc changes"
235+
- Committing without signoff (`-s` flag)
236+
- Missing conventional commit type prefix
237+
- Large commits mixing multiple features/fixes
238+
173239
## Build & Release Process
174240

175241
### Development

0 commit comments

Comments
 (0)