Changeset View
Changeset View
Standalone View
Standalone View
share/man/man9/style.9
Show First 20 Lines • Show All 106 Lines • ▼ Show 20 Lines | |||||
line on the same line(s) as the word | line on the same line(s) as the word | ||||
.Dq Li "Copyright" , | .Dq Li "Copyright" , | ||||
new copyright assertions should be added last. | new copyright assertions should be added last. | ||||
New | New | ||||
.Dq Li "Copyright" | .Dq Li "Copyright" | ||||
lines should only be added when making substantial changes to the file, | lines should only be added when making substantial changes to the file, | ||||
not for trivial changes. | not for trivial changes. | ||||
.Pp | .Pp | ||||
After any copyright and license comment, there is a blank line, and the | After any copyright and license comment, there is a blank line. | ||||
If your code needs to be merged into stable/12 or earlier, it | |||||
needs to have the | |||||
.Li $\&FreeBSD$ | .Li $\&FreeBSD$ | ||||
for non C/C++ language source files. | tag. | ||||
allanjude: Possibly as a separate commit:
For non C/C++ language source files, if applicable, add
.Li… | |||||
Version control system ID tags should only exist once in a file | Otherwise, this tag should be omitted in new code. | ||||
(unlike in this one). | Legacy code will have the tag removed in the future. | ||||
For non C/C++ language source files, | |||||
.Li $\&FreeBSD$ | |||||
is next, if applicable. | |||||
Not Done Inline ActionsThis is a little unclear. Do C/C++ source files need to follow the same rules about including/not including $FreeBSD$? If so, why is this highlighted text where it is? ceri: This is a little unclear. Do C/C++ source files need to follow the same rules about… | |||||
Done Inline ActionsI did a reorder to mention both cases, which should clear things up. imp: I did a reorder to mention both cases, which should clear things up.
| |||||
Non-C/C++ source files follow the example above, while C/C++ source files | Non-C/C++ source files follow the example above, while C/C++ source files | ||||
follow the one below. | follow the one below. | ||||
Version control system ID tags should only exist once in a file | |||||
(unlike in this one). | |||||
All VCS (version control system) revision identification in files obtained | All VCS (version control system) revision identification in files obtained | ||||
from elsewhere should be maintained, including, where applicable, multiple IDs | from elsewhere should be maintained, including, where applicable, multiple IDs | ||||
showing a file's history. | showing a file's history. | ||||
In general, do not edit foreign IDs or their infrastructure. | In general, do not edit foreign IDs or their infrastructure. | ||||
Unless otherwise wrapped (such as | Unless otherwise wrapped (such as | ||||
.Dq Li "#if defined(LIBC_SCCS)" ) , | .Dq Li "#if defined(LIBC_SCCS)" ) , | ||||
enclose both in | enclose both in | ||||
.Dq Li "#if 0 ... #endif" | .Dq Li "#if 0 ... #endif" | ||||
to hide any uncompilable bits | to hide any uncompilable bits | ||||
and to keep the IDs out of object files. | and to keep the IDs out of object files. | ||||
Only add | Only add | ||||
.Dq Li "From: " | .Dq Li "From: " | ||||
in front of foreign VCS IDs if the file is renamed. | in front of foreign VCS IDs if the file is renamed. | ||||
Add | |||||
.Dq Li "From: " | |||||
and FreeBSD git hash with full path name if the file was derived | |||||
from another FreeBSD file and include relevant copyright info | |||||
from the original file. | |||||
.Bd -literal | .Bd -literal | ||||
/* From: @(#)style 1.14 (Berkeley) 4/28/95 */ | /* From: @(#)style 1.14 (Berkeley) 4/28/95 */ | ||||
#include <sys/cdefs.h> | #include <sys/cdefs.h> | ||||
__FBSDID("$FreeBSD$"); | __FBSDID("$FreeBSD$"); | ||||
.Ed | .Ed | ||||
.Pp | .Pp | ||||
Leave one blank line before the header files. | Leave one blank line before the header files. | ||||
Done Inline Actionss/Otherwise/Otherwise,/ bcr: s/Otherwise/Otherwise,/ | |||||
.Pp | .Pp | ||||
Kernel include files | Kernel include files | ||||
.Pa ( sys/*.h ) | .Pa ( sys/*.h ) | ||||
come first. | come first. | ||||
If | If | ||||
.In sys/cdefs.h | .In sys/cdefs.h | ||||
is needed for | is needed for | ||||
.Fn __FBSDID , | .Fn __FBSDID , | ||||
▲ Show 20 Lines • Show All 799 Lines • Show Last 20 Lines |
Possibly as a separate commit:
For non C/C++ language source files, if applicable, add
.Li $\&FreeBSD$
after any copyright and license comment.