[petsc-dev] Ongoing formatting changes
Karl Rupp
rupp at mcs.anl.gov
Mon Jan 28 15:20:57 CST 2013
Hi,
I'm already on the final round of formatting updates. Currently I'm only
meld-ing diff's with uncrustify-output, so this should be done by the
end of the month (yes, it's the 28th already...).
> These changes are pretty obnoxious for contributors who have to
> constantly rebase or merge (generating useless merge commits)
> amidst the constant formatting changes. Since most of these are
> applications of scripts, can we just enqueue them and apply them
> all at once when you consider them complete?
>
>
> By your own evaluation (~10%), these commits constitute a "fringe"
> element at best :) I don't think they are hard to rebase.
>
>
> It depends what your code touches, but even when it touches something
> "close" to your code, the missing context can prevent an auto-merge.
> You're going to have a hell of a time merging plex.c work when Karl
> applies the "for (" rule.
There are basically two types of updates currently applied:
a) Add/Remove whitespace. This should not interfere significantly
since line numbers don't change.
b) Compressing one-liner if/for/while-statements, e.g.
if (flag) {
x = 42;
}
becomes if (flag) x = 42;
This is what can cause the auto-merge to break (and, if not applied
carefully, the build to break... :-( ).
I used to apply the changes only in the evenings, but as the end of all
this is close, I decided to go through it at a higher pace.
> The utility of fully-specified formatting is more than just uniform
> appearance, it's so that the code can be completely stable except where
> useful changes are being made, which makes diffs and merging more
> effective. Constant global tweaks are no better than locally
> reformatting each time we touch a file. It's now very difficult to merge
> changes from 3.3 to petsc-dev. That's okay because we're due for a
> release anyway, but I hope the formatting can be stable after 3.4 is
> released.
Yep, this why I put in all my effort into this (formatting, testing,
Doxygen) now. It's certainly not the most fun work to do, but as soon as
Jed mentioned that we want to go for a release soon, I found it to be
the best time *now*.
Best regards,
Karli
More information about the petsc-dev
mailing list