diff options
author | Junio C Hamano <gitster@pobox.com> | 2014-03-14 14:26:55 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2014-03-14 14:26:55 -0700 |
commit | 2b66d315bbf06d9cec92079e79408648ac05258b (patch) | |
tree | cb14364891d80024eefb350f6b55a13dc19445ab /Documentation | |
parent | 26696382ecc3fd9895da117311d234501127cf81 (diff) | |
parent | f57b6cfdf7b395adc6b3c813109c2eb53e93809a (diff) | |
download | git-2b66d315bbf06d9cec92079e79408648ac05258b.tar.gz |
Merge branch 'jk/doc-coding-guideline'
Elaborate on a style niggle that has been part of "mimic existing
code".
* jk/doc-coding-guideline:
CodingGuidelines: mention C whitespace rules
Diffstat (limited to 'Documentation')
-rw-r--r-- | Documentation/CodingGuidelines | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/Documentation/CodingGuidelines b/Documentation/CodingGuidelines index ef67b53f72..ed432a80ca 100644 --- 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) { |