J
Jorgen Grahn
There is a super simple solution for handling formatting diffs:
1) submit a separate formatting change only revision prior to
making any substantive changes.
2) cmp the object files before and after the formatting only
changes to ensure no substantive changes were made
2a) if 2) fails explain and perform necessary verifications
and unit tests.
That's fine, but surely you see that it does not solve the problem I
outlined above?
The question is not "is this revision an indent-only change?" but
"what are the non-indent changes between now and then?". Some tools
let you ignore whitespace change, but that is not enough if you move
curly brackets around, etc.
This is just a special case of a more general guideline which is
to use the source control system in a modular way just as code is
best broken up into modules. In other words, don't submit single
massive everything-including-the-kitchen-sink revisions. Break up
changes and revisions into smaller sensible pieces.
I do that, but usually a mix of bad tool support and bad local
practices makes that fairly pointless. I produce clean and annotated
histories of my work -- which noone ever reads.
It would have been particularly useful as part of that reviewed
refactoring mentioned upthread. You can often convince yourself that a
single "transformation step" is harmless, but it's hard if you see
four or five lumped together.
/Jorgen