summaryrefslogtreecommitdiff
path: root/Documentation/CodingGuidelines
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2014-04-30 14:24:08 -0700
committerLibravatar Junio C Hamano <gitster@pobox.com>2014-05-02 13:24:57 -0700
commit79fc3ca1232099fd21e5bdef14c1b6fe1d2dbc1c (patch)
treeeb2c5307d3ef31aff20535c5103e943e0140edbf /Documentation/CodingGuidelines
parentCodingGuidelines: once it is in, it is not worth the code churn (diff)
downloadtgif-79fc3ca1232099fd21e5bdef14c1b6fe1d2dbc1c.tar.xz
CodingGuidelines: give an example for case/esac statement
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'Documentation/CodingGuidelines')
-rw-r--r--Documentation/CodingGuidelines12
1 files changed, 11 insertions, 1 deletions
diff --git a/Documentation/CodingGuidelines b/Documentation/CodingGuidelines
index c405b0b9df..169b4358c9 100644
--- a/Documentation/CodingGuidelines
+++ b/Documentation/CodingGuidelines
@@ -42,7 +42,17 @@ For shell scripts specifically (not exhaustive):
- We use tabs for indentation.
- - Case arms are indented at the same depth as case and esac lines.
+ - Case arms are indented at the same depth as case and esac lines,
+ like this:
+
+ case "$variable" in
+ pattern1)
+ do this
+ ;;
+ pattern2)
+ do that
+ ;;
+ esac
- Redirection operators should be written with space before, but no
space after them. In other words, write 'echo test >"$file"'