The problem
I just accidentally committed a change to a file that was only meant to help debug a problem. As a result, I rather messed up the current version of our software, because I accidentally disabled important functionality :-(.
Since this is not the first time this happened (and I'm not the only one it happened to), my question:
Is there a practical mechanism to prevent accidental commits of changes you don't want committed?
I'm thinking of changes where you already know you don't want to commit them when you make them (such as modifications to help debugging or testing).
My current approach:
Usually I just mark such changes with a // FIXME: DEBUG
, so they get listed and highlighted in Eclipse. However this is not enough, as I can still commit these files.
I'd like some mechanism that tells Subversion "do not commit this file in this state" - maybe a special comment or some file property (like "lock this file for commits"). Is there any such mechanism?
The only solution I can think of would be to have a pre-commit hook that scans for special comments, but I'd like to avoid having to configure stuff server-side if I can help it.