Skip to content

Commit f34870a

Browse files
committed
Provide commit message format for Coverity defects
Provide details about the commit message format for Coverity defect fixes submitted. Signed-off-by: Giuseppe Di Natale <dinatale2@llnl.gov>
1 parent 6044cf5 commit f34870a

File tree

1 file changed

+45
-11
lines changed

1 file changed

+45
-11
lines changed

.github/CONTRIBUTING.md

Lines changed: 45 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ started?](#what-should-i-know-before-i-get-started)
2727
* [Commit Message Formats](#commit-message-formats)
2828
* [New Changes](#new-changes)
2929
* [OpenZFS Patch Ports](#openzfs-patch-ports)
30+
* [Coverity Defect Fixes](#coverity-defect-fixes)
31+
* [Signed Off By](#signed-off-by)
3032

3133
Helpful resources
3234

@@ -167,18 +169,10 @@ first line in the commit message.
167169
please summarize important information such as why the proposed
168170
approach was chosen or a brief description of the bug you are resolving.
169171
Each line of the body must be 72 characters or less.
170-
* The last line must be a `Signed-off-by:` tag with the developer's
171-
name followed by their email. This is the developer's certification
172-
that they have the right to submit the patch for inclusion into
173-
the code base and indicates agreement to the [Developer's Certificate
174-
of Origin](https://www.kernel.org/doc/html/latest/process/submitting-patches.html#sign-your-work-the-developer-s-certificate-of-origin).
175-
Code without a proper signoff cannot be merged.
172+
* The last line must be a `Signed-off-by:` tag. See the
173+
[Signed Off By](#signed-off-by) section for more information.
176174

177-
Git can append the `Signed-off-by` line to your commit messages. Simply
178-
provide the `-s` or `--signoff` option when performing a `git commit`.
179-
For more information about writing commit messages, visit [How to Write
180-
a Git Commit Message](https://chris.beams.io/posts/git-commit/).
181-
An example commit message is provided below.
175+
An example commit message for new changes is provided below.
182176

183177
```
184178
This line is a brief summary of your change
@@ -223,3 +217,43 @@ Provide some porting notes here if necessary.
223217
OpenZFS-issue: https://www.illumos.org/issues/1234
224218
OpenZFS-commit: https://github.com/openzfs/openzfs/commit/abcd1234
225219
```
220+
221+
#### Coverity Defect Fixes
222+
If you are submitting a fix to a
223+
[Coverity defect](https://scan.coverity.com/projects/zfsonlinux-zfs),
224+
the commit message should meet the following guidelines:
225+
* Provides a subject line in the format of
226+
`Fix coverity defects: CID dddd, dddd...` where `dddd` represents
227+
each CID fixed by the commit.
228+
* Provides a body list each Coverity defect and how it was corrected.
229+
* The last line must be a `Signed-off-by:` tag. See the
230+
[Signed Off By](#signed-off-by) section for more information.
231+
232+
An example Coverity defect fix commit message is provided below.
233+
```
234+
Fix coverity defects: 12345, 67890
235+
236+
CID 12345: Logically dead code (DEADCODE)
237+
238+
Removed the if(var != 0) block because the condition could never be
239+
satisfied.
240+
241+
CID 67890: Resource Leak (RESOURCE_LEAK)
242+
243+
Ensure free is called after allocating memory in function().
244+
245+
Signed-off-by: Contributor <contributor@email.com>
246+
```
247+
248+
#### Signed Off By
249+
A line tagged as `Signed-off-by:` must contain the developer's
250+
name followed by their email. This is the developer's certification
251+
that they have the right to submit the patch for inclusion into
252+
the code base and indicates agreement to the [Developer's Certificate
253+
of Origin](https://www.kernel.org/doc/html/latest/process/submitting-patches.html#sign-your-work-the-developer-s-certificate-of-origin).
254+
Code without a proper signoff cannot be merged.
255+
256+
Git can append the `Signed-off-by` line to your commit messages. Simply
257+
provide the `-s` or `--signoff` option when performing a `git commit`.
258+
For more information about writing commit messages, visit [How to Write
259+
a Git Commit Message](https://chris.beams.io/posts/git-commit/).

0 commit comments

Comments
 (0)