Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

4
  • 1
    Wouldn't option one when turned on ripple across the majority of the code base quickly resulting in the same big bang of having each file change? Commented Jun 28, 2012 at 18:23
  • @Sign: Exactly my point - When the commit hook changes, your history could deteriorate into something almost useless. Formatting which doesn't change functionality shouldn't be a commit, it should be transplanted throughout the code history. Commented Jun 28, 2012 at 20:12
  • 1
    If the IDE's support it then there is also 3) have the IDE autoformat at save. Then just use the same settings everywhere - this is easiest if you use the default with the IDE. Commented Jun 28, 2012 at 20:25
  • I've done both of these approaches. The first approach is very obtrusive because there will be a ton of changes every time a new file is committed for the first time. The second approach is better for the team, like ripping off a bandaid quick. Commented Apr 8, 2019 at 17:28