From: David Kastrup Date: Thu, 01 May 2014 14:12:15 GMT Subject: Re: [PATCH 4/8] CodingGuidelines: give an example for control statements Message-ID: <87ppjxziyo.fsf@fencepost.gnu.org> In-Reply-To: <1398894312-30763-5-git-send-email-gitster@pobox.com> Junio C Hamano writes: > Signed-off-by: Junio C Hamano > --- > Documentation/CodingGuidelines | 11 +++++++++++ > 1 file changed, 11 insertions(+) > > diff --git a/Documentation/CodingGuidelines b/Documentation/CodingGuidelines > index 1e0c4cf..d72e912 100644 > --- a/Documentation/CodingGuidelines > +++ b/Documentation/CodingGuidelines > @@ -97,6 +97,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 s/noiseword/bashism/ -- David Kastrup