Re: [PATCH 1/5] safe_create_leading_directories(): modernize format of "if" chaining
- From
Jonathan Nieder <jrnieder@gmail.com>
- Date
- Dec 26, 2013, 21:52 UTC
- Message-ID
- <20131226215225.GW20443@google.com>
- In-Reply-To
- <1387696451-32224-2-git-send-email-mhagger@alum.mit.edu>
Michael Haggerty wrote:
> [Subject: safe_create_leading_directories(): modernize format of "if" chaining]
Trivia: it's not so much modernizing as following K&R style, which git more or less followed since day 1. Linux's Documentation/CodingStyle explains:
Note that the closing brace is empty on a line of its own, _except_ in the cases where it is followed by a continuation of the same statement, ie a "while" in a do-statement or an "else" in an if-statement, like this: [...] Rationale: K&R.
Also, note that this brace-placement also minimizes the number of empty (or almost empty) lines, without any loss of readability. Thus, as the supply of new-lines on your screen is not a renewable resource (think 25-line terminal screens here), you have more empty lines to put comments on.
Here it's especially jarring since the function uses a mix of styles. Thanks for cleaning it up.