Re: [PATCH v2] add some bash style we prefer
From: Junio C Hamano <hidden>
Date: 2016-06-15 22:54:29
Heiko Voigt [off-list ref] writes:
During discussion of other patches these preferences have been revealed. Lets add them to the guidelines. Signed-off-by: Heiko Voigt <redacted> --- Here an updated version of the patch.
Thanks.
quoted hunk
On Tue, Aug 14, 2012 at 02:09:35PM -0700, Junio C Hamano wrote:quoted
Heiko Voigt [off-list ref] writes:quoted
@@ -97,6 +102,7 @@ For shell scripts specifically (not exhaustive): interface translatable. See "Marking strings for translation" in po/README. + For C programs:Probably not needed, as there is no such double space between C and Documentation sections.Sorry about that whitespace noise. Cheers Heiko Documentation/CodingGuidelines | 8 ++++++++ 1 file changed, 8 insertions(+)diff --git a/Documentation/CodingGuidelines b/Documentation/CodingGuidelines index 4557711..e70d110 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). + - We prefer writing all control structures without semicolon on the + same line. E.g. "then" should be on the next line for if statements. + The same applies to while, 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.