diff options
author | Heiko Voigt <hvoigt@hvoigt.net> | 2012-08-15 19:06:01 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2012-08-15 11:00:39 -0700 |
commit | 03b05c7db5473329f433c5a3b87965d6fa0f691f (patch) | |
tree | d1bf81adafb2501c04fd94a1240bdb16df9675e7 /Documentation/CodingGuidelines | |
parent | b0fa280751a8a3e7cee093a7fdc3656490abf984 (diff) | |
download | git-03b05c7db5473329f433c5a3b87965d6fa0f691f.tar.gz |
Documentation/CodingGuidelines: spell out more shell guidelines
In earlier days, "imitate the style in the neibouring code" was
sufficient to keep the coherent style, but over time some parts of
the codebase have drifted enough to make it ineffective.
Spell some of the guidelines out.
Signed-off-by: Heiko Voigt <hvoigt@hvoigt.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'Documentation/CodingGuidelines')
-rw-r--r-- | Documentation/CodingGuidelines | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/Documentation/CodingGuidelines b/Documentation/CodingGuidelines index 45577117c2..57da6aadeb 100644 --- a/Documentation/CodingGuidelines +++ b/Documentation/CodingGuidelines @@ -76,11 +76,19 @@ For shell scripts specifically (not exhaustive): - We do not use Process Substitution <(list) or >(list). + - Do not write control structures on a single line with semicolon. + "then" should be on the next line for if statements, and "do" + should be on the next line for "while" and "for". + - We prefer "test" over "[ ... ]". - We do not write the noiseword "function" in front of shell functions. + - We prefer a space between the function name and the parentheses. The + opening "{" should also be on the same line. + E.g.: my_function () { + - As to use of grep, stick to a subset of BRE (namely, no \{m,n\}, [::], [==], nor [..]) for portability. |