I am a big fan of code formatting, since it gives a consistent feel to
all the code, which to me makes it feel a lot more professional.
The primary complaint that I've heard is that a diff on code that
someone else formatted loses knowledge of what they've actually changed.
What I do in this case is first try running Jalopy, seeing how much
whitespace diff changes it will introduce. If the file has a good
lineage, people have been keeping it formatted, I just commit my code.
If it hasn't, then I commit the code that I've changed, with a message
on what I've changed. Then right after that I run Jalopy, and commit
with a message that says 'formatted with jalopy'. This way someone can
easily merge the changes of one of my commits, without having to merge
in the full whitespace, if they just do the merge with the revision
before the formatting commit.
Note the big whitespace diff is only really bad if someone adds new code
and did not run Jalopy before the first commit. If it's just little
fixes then running Jalopy will only do whitespace on the area that has
changed. And if Jalopy is run every time, then everything works out
great.
Chris
Jody Garnett wrote:
Paul Ramsey wrote:
On Mar 10, 2006, at 2:11 PM, Jody Garnett wrote:
I would like to format up 2.2.x when it is released, and then stick
with it (aka format before every commit like the bad old days).
Just to confirm for people, autoformatting would mean that the
workflow would be:
<workworkwork>
<build,test> <your changes work>
svn update <gets any changes since you last updated>
<build,test> <your changes work with other peoples>
svn commit <put changes into archive>
svn update <retrieve correctly formatted copy from archive>
<workworkwork>
I think a lot of people neglect that terminal svn update right now,
because it is not required.
I was thinking something slightly different paul. In our developers
guide it says that you should run Jalopy (the code formatter) before you
commit. I used to get in trouble for not doing this, now that we have
had developers pained by whitespace issues with diffs I see the errors
of my way.
<work><work><work>
<build,test> <yeah the changes work>
<format><update>
<build,test>
svn commit
<workworkwork>
So if two developers are both working on some code, they will get less
conflicts since they both format before commit.
Jody
-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live
webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
Geotools-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-devel
--
Chris Holmes
The Open Planning Project
thoughts at: http://cholmes.wordpress.com
begin:vcard
fn:Chris Holmes
n:Holmes;Chris
org:The Open Planning Project
adr:;;377 Broadway, 11th Floor;New York;NY;10013;USA
email;internet:[EMAIL PROTECTED]
title:VP, Strategic Development
x-mozilla-html:FALSE
url:http://topp.openplans.org
version:2.1
end:vcard