Version control in a nutshell
I'm currently learning about version control in Mercurial ...
I did some extensive research before actually choosing Mercurial instead of Git. I used git for months, but was not happy.
The worst thing about git is that; it deletes uncommitted changes when switching branches.
You might be interrupted by a phone call or something, and then forget to commit ... Resulting in an hour of work lost.
Mercurial instead transfers the uncommitted changes over to the branch when switching ... Not optimal, but at least it doesn't delete them.
There are a lot of differences between Mercurial and Git. Someone neatly summarized it as: "Git is like MAcGyver and Mercurial is like James Bond".
Mercurial also comes with a web server (hgweb) that makes it easier (but still complicated) to set up repositories, while in git you must give users shell access (to a git shell).
I'm much more comfortable with giving people access to a web page then shell access.
On my developer machine I dual boot Windows and Linux. And I pull and push to a repository each time I switch between the two operating systems ... (yes I have samba running, but I want to learn Mercurial SCM)
Sometimes I forget to push and have to resolve a merge when I switch back.
While a merge isn't fun, it's at least not awful with either Mercurial nor Git as they do some of the work for you.
Last week when I was programming, I got a Déjà vu feeling, but discarded it as I'm probably just crazy and need more sleep.
But today I had the same feeling: I was certain that I had added a particular item in my todo file. But it was not there.
So I did a commit and push in Windows. Then switched to Linux and did a pull and update. Then checked todo.
And lo and behold! The item was actually there!
I made some changes, committed and pushed. And switched back to Windows again.
In windows I pulled the changes and updated, but the items where still gone!
This is not good I though to myself. So I started to prepare a bug report to the Mercurial team, but discovered I was several versions behind, and even worse, my Windows and Linux, and repository, all where running different versions.
So I downloaded and installed the newest version on Windows. Downloaded and built the same version on Linux, then did the pull and push dance and ...
Those missing items from todo is now gone from both Windows and Linux! *sight*
Why do version control has to be so complicated!?
My biggest issue with Git and Mercurial is that they add and remove files, rather then making snapshots a la ZFS, or just use (virtual?) folders instead.
Having a program that deletes stuff from your projekt is bad by design. If I want to delete stuff, I want to do it manually.
So will I make my own version control!? I rather not, but probably will.
Written by Johan Zetterberg Mars 1st, 2016.