aboutsummaryrefslogtreecommitdiffstats
path: root/Documentation/CodingGuidelines
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2014-04-30 14:25:11 -0700
committerJunio C Hamano <gitster@pobox.com>2014-05-02 13:24:57 -0700
commit6117a3d4946e35c7d4a38c0b443891c81808a838 (patch)
treea7f0a95f89c1717de35f6e80ee976636f1136e2e /Documentation/CodingGuidelines
parent9dbe780174892a35d6f1e19495c13b9edb9d88fd (diff)
downloadgit-6117a3d4946e35c7d4a38c0b443891c81808a838.tar.gz
CodingGuidelines: give an example for shell function preamble
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'Documentation/CodingGuidelines')
-rw-r--r--Documentation/CodingGuidelines14
1 files changed, 11 insertions, 3 deletions
diff --git a/Documentation/CodingGuidelines b/Documentation/CodingGuidelines
index 47db6b3ce3..0a574b204c 100644
--- a/Documentation/CodingGuidelines
+++ b/Documentation/CodingGuidelines
@@ -123,9 +123,17 @@ For shell scripts specifically (not exhaustive):
- 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 () {
+ - We prefer a space between the function name and the parentheses,
+ and no space inside the parentheses. The opening "{" should also
+ be on the same line.
+
+ (incorrect)
+ my_function(){
+ ...
+
+ (correct)
+ my_function () {
+ ...
- As to use of grep, stick to a subset of BRE (namely, no \{m,n\},
[::], [==], or [..]) for portability.