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

Debarshi 'Rishi' Ray debarshi.ray at gmail.com
Fri Mar 2 15:25:07 CET 2007


> 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.

Yes. It occurred to me, but since Otavio said it would be alright to make the
indentation changes in a separate patch I thought it would be fine. Such
formatting related changes have been intrusive in the past too. eg.,
'commit 93ca20d8aebd0d04dbb00b86a2903c992e59a96b' on the master branch. This
problem may occur there also.

> 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.
> 
> [snip]
>
> 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

Do we have a coding style for each file or one for the whole tree? I would
prefer a uniform coding style for the entire tree, and then have comments
in them for Emacs and Vim.

This is because I feel having a separate style for every file would only
lead to more confusion and lesser readability. Each file is not totally
self-contained, and one has to consult others while working on one of them.
Moreover there is the possibility of multiple subtly and not so subtly
different coding styles in the entire code base.

Maybe we need to modify/improve/enforce
http://www.gnu.org/software/parted/snippets/CodingStyle at some point of
time.

> 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.

I would rather have a regular style in every file, and comments to avoid the
odd deviation. :-)

The problem is that if we want to enforce a uniform coding style throughout
the code base, there will be the odd file (like parted/ui.c) which will need
to be majorly re-formatted.

What do you think?

Happy hacking,
Debarshi
-- 
husband    v. use sparingly; conserve; save
husbandry  n. frugality; thrift; agriculture
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://lists.alioth.debian.org/pipermail/parted-devel/attachments/20070302/daeea690/attachment.pgp


More information about the parted-devel mailing list