Hi,
PeterX wrote:I've read the Osdev.org wiki about code managment and the Wikipedia article about Revision Control System. Three questions about VCS remain for me:
1.) Is there a simple versioning control system for very small code projects? This is NOT about the best IDE (which is highly subjective and was already discussed in this forum) but about simplicity in its usage.
I've used cvs, svn, bazaar and git (not familiar with mercurial). I must say git is the best so far, scales pretty well from small codebase to large ones. There's a catch though, it does not handle long history well, so from time to time it is recommended to merge old commits to keep your repo effective (called
squash rebase). Cloning even a small repository could be extremely slow if it has many commits. (This also depends on you computer and your network connection of course, but let's say a repo with 10Mb worth of source and over 50000 commits will probably grant you a coffee-break.) For a local repo the number of commits only matters if you switch branches frequently.
PeterX wrote:2.) Is there an easy way to produce a commit/update (or whatever it is called) when I remove a block of code? Maybe even automatically and/or done by the editor/IDE?
The good thing about git is that you are not forced to use all of its features. You can work on a single master branch if you want to keep it simple. If you're not adding new files just modifying existing ones then a simple 'git commit -a -m "comment"' enough (followed by a 'git push' if you also want to save it remotely). Since git is extremely popular, many editor/IDE has a plugin to make your life even easier. Some supports automatic commits, but I would recommend against those. I think it's better if you create a commit after a particular step is done (which might spread across multiple files), and giving a descriptive comment what the modification is about pays out on the long run (an automatic commit will never give you informative comments).
PeterX wrote:3.) Is there a way to upload code blocks when they are removed? I mean there is the old repo and the new repo but can I explicitely collect code blocks which I removed into a repo?
The easiest way with git is 'git diff (file)'. This will create a list of removed blocks in a format that the 'patch' command can understand. Not sure about repos (in theory it can compare two repos, but frankly I've never used that feature), but comparing two branches or two particular time in the same branch is a piece of cake. Has a funky command line though, for example you use "HEAD" to refer to the current state, and "HEAD^" to refer to the state before the last commit, "HEAD^^" or "HEAD~2" to the state before the last two commits etc. Other oddities include deletion is ":". That's right, a colon. Thankfully you only need to learn the commands once, and there are only a few you'll need. Also if you prefer there are awesome GUI applications to help you, like gitk, and some of the aforementioned editor/IDE plugins are pretty neat too.
PeterX wrote:I hope these questions aren't nonsense.
Happy hacking
Peter
Sure they make sense, hope I could help.
Cheers,
bzt