Andrew's git
/
gitweb.git
/ diff
summary
|
log
|
commit
| diff |
tree
commit
grep
author
committer
pickaxe
?
re
Merge branch 'jk/doc-coding-guideline'
author
Junio C Hamano
<gitster@pobox.com>
Fri, 14 Mar 2014 21:26:55 +0000
(14:26 -0700)
committer
Junio C Hamano
<gitster@pobox.com>
Fri, 14 Mar 2014 21:26:55 +0000
(14:26 -0700)
Elaborate on a style niggle that has been part of "mimic existing
code".
* jk/doc-coding-guideline:
CodingGuidelines: mention C whitespace rules
Documentation/CodingGuidelines
patch
|
blob
|
history
raw
(from parent 1:
2669638
)
diff --git
a/Documentation/CodingGuidelines
b/Documentation/CodingGuidelines
index ef67b53f721f28e5442c00273dec5f1582f555be..ed432a80ca62eeb6a75e08870d9c8f8eaf4ab6d8 100644
(file)
--- a/
Documentation/CodingGuidelines
+++ b/
Documentation/CodingGuidelines
@@
-126,6
+126,17
@@
For C programs:
"char * string". This makes it easier to understand code
like "char *string, c;".
+ - Use whitespace around operators and keywords, but not inside
+ parentheses and not around functions. So:
+
+ while (condition)
+ func(bar + 1);
+
+ and not:
+
+ while( condition )
+ func (bar+1);
+
- We avoid using braces unnecessarily. I.e.
if (bla) {