git.99rst.org
/
git.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
| inline |
side by side
(parent:
6a49909
)
CodingGuidelines: give an example for control statements
author
Junio C Hamano
<redacted>
Wed, 30 Apr 2014 21:24:52 +0000
(14:24 -0700)
committer
Junio C Hamano
<redacted>
Fri, 2 May 2014 20:24:57 +0000
(13:24 -0700)
Signed-off-by: Junio C Hamano <redacted>
Documentation/CodingGuidelines
patch
|
blob
|
history
diff --git
a/Documentation/CodingGuidelines
b/Documentation/CodingGuidelines
index 11704fb84cb3b9652223ad17631c999bafc268d8..47db6b3ce36a7964127c294740ca0073a6181050 100644
(file)
--- a/
Documentation/CodingGuidelines
+++ b/
Documentation/CodingGuidelines
@@
-107,6
+107,17
@@
For shell scripts specifically (not exhaustive):
"then" should be on the next line for if statements, and "do"
should be on the next line for "while" and "for".
+ (incorrect)
+ if test -f hello; then
+ do this
+ fi
+
+ (correct)
+ if test -f hello
+ then
+ do this
+ fi
+
- We prefer "test" over "[ ... ]".
- We do not write the noiseword "function" in front of shell
git clone https://git.99rst.org/PROJECT