Hi, I had a look at tzcode/localtime.c today, and the indentation looks like a mess. It's a wild mixture between 2 spaces, 4 spaces, 1 tab, 2 tabs, and I couldn't see any pattern or reasonable rule set that would account for the whole file. Is this apparent mess intentional? If so, what is the history and rationale behind it? If not, who can fix this? Roland
On 24/03/2022 22:57, Roland Illig via tz wrote:
Hi,
I had a look at tzcode/localtime.c today, and the indentation looks like a mess. It's a wild mixture between 2 spaces, 4 spaces, 1 tab, 2 tabs, and I couldn't see any pattern or reasonable rule set that would account for the whole file.
It is true that the indentation is inconsistent, although at least the usage of tabs and spaces for indentation is correct in the sense that there are no cases of a space followed by a tab and all the sequences of spaces used for indentation are shorter than the tab size of 8.
Is this apparent mess intentional? If so, what is the history and rationale behind it?
I'm not sure, but from the "git blame" output, it looks like Arthur Olson pretty much stuck with a shift width of 8 (matching the tab size), and Paul's shift widths were a bit more variable, perhaps to fit the code in 80 columns nicely, and also more use of lining up the parts of expressions split across lines with the opening parentheses of the previous lines.
If not, who can fix this?
Perhaps the old proverb should be followed: "If it ain't broke, don't fix it." -- -=( Ian Abbott <abbotti@mev.co.uk> || MEV Ltd. is a company )=- -=( registered in England & Wales. Regd. number: 02862268. )=- -=( Regd. addr.: S11 & 12 Building 67, Europa Business Park, )=- -=( Bird Hall Lane, STOCKPORT, SK3 0XA, UK. || www.mev.co.uk )=-
On 3/25/22 09:46, Ian Abbott via tz wrote:
I'm not sure, but from the "git blame" output, it looks like Arthur Olson pretty much stuck with a shift width of 8 (matching the tab size), and Paul's shift widths were a bit more variable, perhaps to fit the code in 80 columns nicely, and also more use of lining up the parts of expressions split across lines with the opening parentheses of the previous lines.
Yes, Arthur and I have different indentation styles. I've found lesser indentation to be useful when squeezing in fixes that require deeper nesting, without going past 80 columns or altering lines that don't need changing. There is a tension between having source code that looks nice and consistent now, vs a repository where "git blame" works all the way back to the beginning.
Paul Eggert via tz <tz@iana.org> writes:
There is a tension between having source code that looks nice and consistent now, vs a repository where "git blame" works all the way back to the beginning.
Just in case you weren't already aware of it, there is a Git configuration option intended to help with that: blame.ignoreRevsFile Ignore revisions listed in the file, one unabbreviated object name per line, in git-blame(1). Whitespace and comments beginning with # are ignored. This option may be repeated multiple times. Empty file names will reset the list of ignored revisions. This option will be handled before the command line option --ignore-revs-file. Conventionally, people use a file named .git-blame-ignore-revs at the top level for this purpose. The basic idea is that any whitespace changes go into a separate commit independent of any code changes, and then those commits are added to that file. -- Russ Allbery (eagle@eyrie.org) <https://www.eyrie.org/~eagle/>
Paul Eggert wrote in <430bc674-ecf4-877b-31b9-5e469dcc7b77@cs.ucla.edu>: |On 3/25/22 09:46, Ian Abbott via tz wrote: |> |> I'm not sure, but from the "git blame" output, it looks like Arthur |> Olson pretty much stuck with a shift width of 8 (matching the tab size), |> and Paul's shift widths were a bit more variable, perhaps to fit the |> code in 80 columns nicely, and also more use of lining up the parts of |> expressions split across lines with the opening parentheses of the |> previous lines. | |Yes, Arthur and I have different indentation styles. I've found lesser |indentation to be useful when squeezing in fixes that require deeper |nesting, without going past 80 columns or altering lines that don't need |changing. | |There is a tension between having source code that looks nice and |consistent now, vs a repository where "git blame" works all the way back |to the beginning. I am not sure whether -w could overcome this completely. I have alias.bla blame -w -CCC -M4 --End of <430bc674-ecf4-877b-31b9-5e469dcc7b77@cs.ucla.edu> --steffen | |Der Kragenbaer, The moon bear, |der holt sich munter he cheerfully and one by one |einen nach dem anderen runter wa.ks himself off |(By Robert Gernhardt)
participants (5)
-
Ian Abbott -
Paul Eggert -
Roland Illig -
Russ Allbery -
Steffen Nurpmeso