Version Control and Coding Formatting

Posted by Martin Giffy D'Souza on Stack Overflow See other posts from Stack Overflow or by Martin Giffy D'Souza
Published on 2010-04-06T22:13:14Z Indexed on 2010/04/06 22:23 UTC
Read the original article Hit count: 365

Filed under:
|

Hi,

I'm currently part of the team implementing a new version control system (Subversion) within my organization. There's been a bit of a debate on how to handle code formatting and I'd like to get other peoples opinions and experiences on this topic.

We currently have ~10 developers each using different tools (due to licensing and preference). Some of these tools have automatic code formatters and others don't.

If we allow "blind" checkins the code will look drastically different each time someone does a check in. This will make things such as diffs and merges complicated.

I've talked to several people and they've mentioned the following solutions:

  1. Use the same developer program with the same code formatter (not really an option due to licensing)
  2. Have a hook (either client or server side) which will automatically format the code before going into the repository
  3. Manually format the code.

Regarding the 3rd point, the concept is to never auto-format the code and have some standards. Right now that seems to be what we're leaning towards. I'm a bit hesitant on that approach as it could lead to developers spending a lot of time manually formatting code.

If anyone can please provide some their thoughts and experience on this that would be great.

Thank you,

Martin

© Stack Overflow or respective owner

Related posts about tortoisesvn

Related posts about subversion