[parted-devel] indentation changes render parted/ui.c nearly unmergeable

Jim Meyering jim at meyering.net
Fri Mar 2 11:49:26 CET 2007


Hi Debarshi,

I see that your recent indentation changes modify nearly every line
of parted/ui.c.  Did you realize that with such a change, nearly any
delta from 1.8's ui.c will no longer apply to the one on the trunk?
I.e., there will *always* be a merge conflict for any change to that file.

This means that either the exact same changes should be made to the copy
of ui.c on any other branch likely to share patches with the trunk, or
(more likely) the indentation changes should just be backed out.

If the indentation changes remain, then be aware that they will
invalidate every distro's patches against that file, so it's not
just a question of staying close to version-controlled branches.

Making indentation (and formatting in general) more uniform for the
project would be a good thing, but I think there is a better way, at
least for the short term.  If we can start making global modifications,
I'd much rather go all-out and mechanically reformat to whatever coding
style we settle on.

Here's what I'll probably be doing:
1) identify which style of indentation (spaces or TABs) applies to each file
2) if it's uniformly one or the other, codify that via comments for emacs and
     vim at the bottom of the file
3) if it's nearly uniformly one or the other, make the few changes and codify
    as in #2
4) if there's a significant mix, convert to spaces-only[*] and codify

Depending on how many files are "irregular", I might add comments
only to the minority, with the assumption that developers will
use the proper settings to do the right thing in the "regular" case.

Then, it should be much easier to keep this one small part of
formatting consistent.

Jim

[*] I hope there's no need to explain why spaces-only is better
than indenting with TABs.



More information about the parted-devel mailing list