Hi, > Von: Stefan Sperling [mailto:s...@elego.de] > > On Tue, Jun 14, 2011 at 04:32:50PM +0200, Markus Schaber wrote: > > Hi, Konstantin, > > > A good policy is to educate the developers to commit whitespace-only > > > changes in a separate commit. > > > > I know that. And I'm searching for a tool allowing me to do just that. > > > > Especially when you make a self-contained change (e. G. pure addition > > of new methods or a new class, not touching any existing code pathes) > > to a large "legacy" code file, and accidentally hit "Reformat code" in > > ignorance of the fact that this file does not yet conform to the style > > guide, you're busted. > > So why doesn't the IDE have an undo button that restores the previous > format? I don't think this warrants introducing a new feature in the > version control system. Rather, the IDE should be fixed.
The IDE has such an undo button, which works fine if I notice that in the moment of reformatting. However, as I am used to have the large majority of code files (including all my own files) formatted properly, I press that button frequently, and usually notice the "accident" hours later when I want to actually commit the changes. I know that the "real" fix is to change all the existing files in the repository to proper formatting (which is in the works, but it will take some time), and the second real fix is to not press the reformat button in those files. And I also do not want this as a feature included in SVN, but just wondered whether there is a ready-made script or external tool which does that work. Thanks, Markus Schaber