Re: Source formatting issues while maintaining code
"Michael T. Nygard" <[email protected]> Mon, 24 Nov 2008 10:33:07 -0600
| Newsgroups | gmane.comp.programming.language-of-the-year |
|---|---|
| Message-ID | <[email protected]> |
You should compare two frequencies: 1. How often do you read the code? 2. How often do you need to know who changed a specific line? (Reformatting everything will be a discontinuity in this info.) It's likely that F_1 >> F_2, so I would tend toward reformatting everything to a single standard. On Nov 23, 2008, at 10:06 AM, Tushar Joshi wrote: > Hi, > > Let me add some more points here: > > >>meaningful "blame" information, > Exactly this is the main reason we want to maintain the code > formatting > > >> that has a setting to ignore whitespace-only changes. > I have tried using the Eclipse Compare/Patch setting of ignore white > spaces but when it encounters a auto formatted file it shows > numerous changes and the ignore whitespace setting doesn't seem to > work in that case. > > But Eclipse compare option is so easy that it will always be my > first preference to use rather than a external CVS diff tool which > is intelligent, and even I don't know of such a tool > > Tushar Joshi > http://www.tusharvjoshi.com > > > On Sun, Nov 23, 2008 at 10:31 AM, Charles Miller > <[email protected]> wrote: > > On 23/11/2008, at 10:12 AM, Tushar Joshi wrote: > > > Have any one implemented any creative method to solve this problem? > > If it's important to you, you could just bite the bullet, run the > entire source tree through an auto-formatter with the same settings as > your IDE, then re-check it in. You'll make it a lot harder to get > meaningful "blame" information, but at least the code will be > consistently formatted from then on. > > Alternatively, you could get a better diff program, preferably one > that has a setting to ignore whitespace-only changes. > > C > > Michael T. Nygard [email protected] http://www.michaelnygard.com/ Author of "Release It!" http://pragmaticprogrammer.com/titles/mnee/index.html