From: Jeff King Date: Sun, 18 Nov 2007 03:12:16 GMT Subject: Re: [PATCH 1/3] send-pack: track errors for each ref Message-ID: <20071118031215.GB4560@sigill.intra.peff.net> In-Reply-To: <7v6400z6tk.fsf@gitster.siamese.dyndns.org> On Sat, Nov 17, 2007 at 05:21:59PM -0800, Junio C Hamano wrote: > > Sorry, I don't see the style nit you're mentioning here. > > I think Daniel is referring to "Put 'else' on the same line as > the brace that closes the corresponding 'if' opened", iow: > > if (...) { > ... > } else { > ... > } Ah. We are really inconsistent about that (I count about 333 non-cuddled (but possible to cuddle) versus 499 cuddled). Should we put something in the CodingGuidelines? I am also happy to roll this change into a style patch. For reference, I counted with: # cuddled: grep '} *else' *.c | wc -l # possible but non-cuddled # when we find an 'else', if the previous line had a '}' # on it, then it is a hit. There are a few false positives # when the "} else" is from an outer block scope # And no, this sed invocation probably isn't totally portable. :) sed -n '/else/{x; /}/{x;p}}; h' *.c | wc -l # or to check the accuracy sed -n '/else/{x; /}/{p;x;p}}; h' *.c -Peff