Skip to content

Commit ffcd76b

Browse files
committed
Merge branch 'as/doc-for-devs' into maint
* as/doc-for-devs: Documentation: move support for old compilers to CodingGuidelines SubmittingPatches: add convention of prefixing commit messages
2 parents e970ec3 + a26fd03 commit ffcd76b

File tree

2 files changed

+16
-13
lines changed

2 files changed

+16
-13
lines changed

Documentation/CodingGuidelines

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,14 @@ For C programs:
112112

113113
- We try to keep to at most 80 characters per line.
114114

115+
- We try to support a wide range of C compilers to compile git with,
116+
including old ones. That means that you should not use C99
117+
initializers, even if a lot of compilers grok it.
118+
119+
- Variables have to be declared at the beginning of the block.
120+
121+
- NULL pointers shall be written as NULL, not as 0.
122+
115123
- When declaring pointers, the star sides with the variable
116124
name, i.e. "char *string", not "char* string" or
117125
"char * string". This makes it easier to understand code

Documentation/SubmittingPatches

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,14 @@ Checklist (and a short version for the impatient):
99
- the first line of the commit message should be a short
1010
description (50 characters is the soft limit, see DISCUSSION
1111
in git-commit(1)), and should skip the full stop
12+
- it is also conventional in most cases to prefix the
13+
first line with "area: " where the area is a filename
14+
or identifier for the general area of the code being
15+
modified, e.g.
16+
. archive: ustar header checksum is computed unsigned
17+
. git-cherry-pick.txt: clarify the use of revision range notation
18+
(if in doubt which identifier to use, run "git log --no-merges"
19+
on the files you are modifying to see the current conventions)
1220
- the body should provide a meaningful commit message, which:
1321
. explains the problem the change tries to solve, iow, what
1422
is wrong with the current code without the change.
@@ -119,19 +127,6 @@ in templates/hooks--pre-commit. To help ensure this does not happen,
119127
run git diff --check on your changes before you commit.
120128

121129

122-
(1a) Try to be nice to older C compilers
123-
124-
We try to support a wide range of C compilers to compile
125-
git with. That means that you should not use C99 initializers, even
126-
if a lot of compilers grok it.
127-
128-
Also, variables have to be declared at the beginning of the block
129-
(you can check this with gcc, using the -Wdeclaration-after-statement
130-
option).
131-
132-
Another thing: NULL pointers shall be written as NULL, not as 0.
133-
134-
135130
(2) Generate your patch using git tools out of your commits.
136131

137132
git based diff tools generate unidiff which is the preferred format.

0 commit comments

Comments
 (0)