Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2014-05-01 01:24:52 +0400
committerJunio C Hamano <gitster@pobox.com>2014-05-03 00:24:57 +0400
commit9dbe780174892a35d6f1e19495c13b9edb9d88fd (patch)
tree15961f95b6cb017492acd6c3589f9ae141a00fc1 /Documentation/CodingGuidelines
parent6a49909b52b48592234da6a53bfe74ea34c302c6 (diff)
CodingGuidelines: give an example for control statements
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'Documentation/CodingGuidelines')
-rw-r--r--Documentation/CodingGuidelines11
1 files changed, 11 insertions, 0 deletions
diff --git a/Documentation/CodingGuidelines b/Documentation/CodingGuidelines
index 11704fb84c..47db6b3ce3 100644
--- 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