From: Junio C Hamano Date: Fri, 07 Sep 2012 16:45:32 GMT Subject: Re: [PATCH 0/9] new git check-ignore sub-command Message-ID: <7v627pzsr7.fsf@alter.siamese.dyndns.org> In-Reply-To: Adam Spiers writes: > On Sun, Sep 2, 2012 at 9:35 PM, Junio C Hamano wrote: >> * avoid unnnecessary braces {} around single statement blocks, e.g. >> >> -if (exclude) { >> +if (exclude) >> return exclude; >> -} >> >> * else should follow close brace '}' of if clause, e.g. >> >> if (...) { >> ... >> -} >> -else { >> +} else { >> ... > > What about when the if clause requires braces but the else clause > doesn't? Should it be > > if (...) { > ...; > ...; > } else > ...; > > or > > if (...) { > ...; > ...; > } > else > ...; > > ? Neither. We try to do (but often fail ;-) if (...) { ...; ...; } else { ...; } following the kernel style, unless there is good reason not to.