Thursday, November 15, 2007

"Save Point" Before Commit

Many times I have some changes in code that I am quite satisfied with but I don't feel it's time to commit. I want to continue working but thinking about that if I break something bad I would have to revert and lost this changes makes me uneasy. This situation is bad for the next micro task since I can not do all-out hacking to the code.

The solution for the problem is : zip it (or rar it if you use winrar like me), compress the directory where the changes occur on the same dir as it is. When something goes wrong I just delete the whole dir and extract the zipped one, voila, automatic (well, actually manual if you compare it to svn) revert. This whole thing only require several right-clicks if you have the system right (compression application that install a contextual menu in windows).

This could also work if I want to experiment with several alternative of implementation. Implement one alternative, zip it, revert the dir and star the new one and see/compare. If you make three alternative you need more than right-clicks though since you have the renaming todo (but that's obvious, of course). Sounds familiar? you got it, it's like branching in version control system although much raw.

Why not just copy it? well, it's actually easier since I have tried both, also having it on the same root directory as the directory we are working on is really helpful too.

For small "save point", and a little pseudo branching, until the moment of committing arrive, zipping it could save the day.

No comments: