I recently blogged about the Git v2.0.0 release, what changed, and why should you care. Unfortunately the conclusion was that nothing much changed (other than the usual new features and bug fixes). In this post I will discuss what should have changed, and why.
What is needed
Fortunately, Git has had the Git User’s Survey in the past, so we know what users want.
- user-interface: 3.25
- documentation: 3.22
- tools (e.g. GUI): 3.01
- more features: 2.41
- portability: 2.34
- performance: 2.28
- community (mailing list): 1.70
- localization (translation): 1.65
- community (IRC): 1.65
Obviously, since user-interface and documentation are the areas that need more improvement, that’s what Git v2.0.0 should have focused, right?
I already mentioned this in the other post, but I’ll do it again.
First of all, Git as a long history of never breaking user expectations (other than the Git v1.6.0 fiasco (which changed all the git-foo commands with ‘git foo’)), and as such a lot of thought is devoted into ways to minimize changes in behavior, or even how to avoid it completely. Perhaps too much care is devoted into this.
The preparation for Git v2.0.0 started more than three years ago with a mail from Junio C Hamano, asking for developers to submit ideas for changes that normally would not happen because they break backwards compatibility, he invited us to think as if “we were writing Git from scratch”. This big release that would break backwards compatibility was going to be named “1.8.0″ and people started to submit ideas for this important release. Eventually too much time passed, the versioning scheme changed, v1.8.0 was released, and the changes proposed for v1.8. slipped into what is now v2.0.
Since no substantial changes in behavior happened since v1.0, it would follow that v2.0 was an important release, and a good opportunity to gather all the ideas about what needs to change in Git. However, seemingly out of nowhere, without any discussion or even a warning, the maintainer tagged v2.0.0-rc0, and therefore all the features that were not already merged couldn’t be merged for v2.0.0.
Thus v2.0.0 was destined to have a small list of changes, and that’s how it remained.
What could have changed
The following is a list of things that I argued should be part of Git v2.0.0.
I wrote a whole post about the issue, but basically, ‘
git pull‘ is broken for the most common use-case: update the current branch.
This is a known issue that has been discussed over and over, and everyone agrees that it is indeed an issue, and something needs to be done to fix it.
There have been different proposals, but by far the most comprehensive and simple is to add a new ‘
git update‘ command.
This way when you want to merge a pull request, you do ‘
git pull‘, and when you just want to update the current branch, you do ‘
git update‘, which by default would barf if there’s divergence between your local branch (e.g. ‘master’), and the remote one (e.g. ‘origin/master’), instead of doing a merge by default. This should decrease substantially the amount of “evil merges”, merges that happened by mistake, usually by somebody that is not familiar with Git.
The patches are relatively new, but the command is simple, so there isn’t much danger of screwing things up.
The publish tracking branch
I also wrote a blog post about this; basically Git’s support for triangular workflows is not the best.
A triangular workflow is when you pull from one location (e.g. central repo), and push to another (e.g. personal GitHub fork). If you are using upstream tracking branches (you should), you have to make a decision where you set your upstream; the central repo, or your personal one. Depending on which you use, is the advantages you get, but you cannot have it all.
But with the publish tracking branch you can have all the advantages.
I’ve been cooking these patches for a long long time and I have to say this is one essential feature for me, and they patches work perfectly.
Support for Mercurial and Bazaar
Support for Mercurial and Bazaar repositories has been cooking for a long time in the “contrib” area (you can both pull and push). At this point in time the code is production-ready, and it was already graduated and merged to be released in Git v2.1.
However, the maintainer suddenly changed his mind and decided it would be better to distribute them as third party tools. He didn’t give any valid reason and clearly didn’t think it through, but they are now separate.
Use “stage” instead of “index”
Everybody agrees that “index” is a horrible name for Git’s “staging area”, however, nobody has done much to fix the problem.
One first step is to replace all the –cached and –index options with –staged and –no-work, which are much simpler to understand.
Another step is to add a ‘
git stage‘ command that acts as a helper to work with the staging area: ‘
git stage add‘, ‘
git stage diff‘, ‘
git stage reset‘, ‘
git stage rm‘, ‘
git stage edit‘, and so on.
Virtually every version control system has default aliases (e.g. hg co, cvs ci, svn di, etc.), except Git.
Adding default aliases is very simple to do and only brings advantages. If you don’t like the default alias, you can override it.
Shoulda coulda woulda
It would have been great if you could just do ‘
git clone hg::mercurial-repo‘ without installing anything extra, if everybody could start using ‘
git update‘ instead of ‘
git pull‘, if you could do ‘
git stage diff‘, or ‘
git reset --stage‘. Also, if triangular workflows were properly supported.
Unfortunately that’s not the case, and Git v2.0.0 is already released, and there isn’t much to be excited about.
You might think “perhaps for Git v3.0″ (which could happen in two years, or ten, how knows), but if the past is any indication of the future, it won’t happen, specially since I’ve given up on all these patches.
The fact of the matter is that in every release of Git, there is only one focus: performance. Despite the fact that it’s #6 in the list of concerns of users, Git developers work on this because that’s their area of expertise, because it’s fun for them, and because they get paid to do so. There are occasional new features, and a bit of portability now and then, but for the most part Windows support is neglected in Git, which is why the msysgit project was born.
The documentation will always remain cryptic, because for the developers, it’s not cryptic, it’s very clear. And the user-interface will never change, because the developers don’t like change.
If you don’t believe me look at the backwards-incompatible changes in Git v2.0.0, or in fact, try to think back to the last time Git changed anything. Personally other than the git-foo -> ‘git foo’ change in v1.6.0 (which was horribly handled), I can’t think of anything but minor changes.
Anyway, you can use all these features I listed today (and more) if you use git-fc instead of Git. It is my own fork of Git that has all the features of Git, plus more.
Is there anything in that list that I missed? Do you think Git v2.0.0 has enough changes as it is?