Subject: Re: [PATCH 1/2] tests: eliminate unnecessary setup test assertions

From: Jonathan Nieder <[email-masked]>
Date: Fri, 6 May 2011 17:26:29 -0500

Jeff King wrote:

> So there are definitely particular people who prefer different styles
> (and I recalled that Junio and I differed on this style point, which is
> confirmed here). Interestingly, you are the only person to fall right in
> the middle.  I guess that means you are good at emulating surrounding
> code. :)

Probably my older code leaves out the space more often, and newer code
includes it.  There is an odd kind of logic that can be used to
justify including or not including the space, namely:

In C, a function definition starts with an expression that looks
something like a function call, as in "double sin(double x);".  So
when you want to know everything there is to know about the sine
function, you can do a "git grep -F -e 'sin('", and it will return to
you its definition and a list of callers.

The shell function definition syntax looks oddly like an old-style C
prototype "f()".  But do not be misled: to duplicate the above
property familiar from C, one needs to include a space before the
parentheses, so "git grep -F -e 'f '" will return its definition and a
list of callers.

Of course the same argument works backwards: if you want the
definition without the callers, then only the spaceless syntax will
allow you to grep for 'f()'.

Unlike brace placement, this seems to be a question of style with no
right answer. :)