Popularity of Git/Mercurial/Bazaar vs. which to re

2019-01-03 00:41发布

Going by the number of questions on this site for these three distributed version control systems, it seems like Git either

  1. is more popular, or
  2. is more difficult (hence requiring more questions), or
  3. has more features (hence requiring more questions).

Or most probably a combination of the three. (Let's say that popularity on this site equates to popularity at large.) Here are the numbers:

enter image description here

It's not entirely satisfactory having three competing yet largely equivalent open source products to choose from. Personally I use Git and I'm fine with the other two. But when it comes to recommending one system over the others, I'd like to ask: can we start recommending one safely yet?

Comments from mid-2009: The recent historical popularity of Subversion is clearly reflected by the number of questions, indicating at least a small tipping of the scales towards Git over the Mercurial or Bazaar.

Comments from mid-2010: Look at that huge relative increase in Mercurial numbers. Obviously only two-data points aren't enough to show a trend, but it looks like Git and Subversion are largely entrenched, Mercurial has seen a lot of growth, and Bazaar has remained relatively quiet.

Brief comment, mid-2011: Can we just call Git the winner? :) No, I accept the argument that number of questions is not equivalent to popularity. Numbers sure are strong, though.


Code to reproduce the above plot:

import datetime as dt
import matplotlib.pyplot as plt


dates = [
    "01/06/2009",
    "01/07/2010",
    "01/07/2011",
    "01/07/2012",
    "01/07/2013",
    "01/07/2014",
    "01/07/2015",
    "01/07/2016",
    "01/06/2017",
    "28/08/2018",
]
x = [dt.datetime.strptime(d, "%d/%m/%Y").date() for d in dates]

git = [726, 3725, 9225, 17523, 27862, 41478, 55315, 71056, 86958, 102362]
svn = [2353, 5323, 9028, 12687, 15587, 18846, 21209, 23037, 24692, 25525]
mercurial = [169, 1120, 2765, 4221, 5230, 6030, 6651, 7134, 7524, 7765]
bazaar = [50, 159, 252, 351, 425, 483, 506, 525, 534, 539]

ax = plt.gca()

ax.grid()
plt.plot(x, git, label="[git]")
plt.plot(x, svn, label="[svn]")
plt.plot(x, mercurial, label="[mercurial]")
plt.plot(x, bazaar, label="[bazaar]")
plt.gcf().autofmt_xdate()
plt.ylim(0)

plt.legend()

# plt.show()
plt.savefig("comparison.png", transparent=True, bbox_inches="tight")

11条回答
闹够了就滚
2楼-- · 2019-01-03 01:23

Canonical (Ubuntu) tracks software package usage for their distro, so there's no need to rely on Stack Exchange issue counts to measure popularity. However, as others have pointed out, this only tracks Ubuntu users and Canonical (Ubuntu) uses and recommends bzr (sample bias). Nonetheless...

            2011    2011    2011           
Package     Aug 3   Sep 29  Dec 9   Change 
------      ------  ------  ------  ------ 
git-core    3647    3402    3236    -11%   
bzr         4975    5286    6070    +22%   
mercurial   3411    3387    3461     +1%   

The decline in votes for the git-core package makes me think I've done something wrong like greped the wrong package name from the ubuntu popularity table. Or maybe even this "vote" count is related to installations and not actual usage of the software.

Here's some historical data for trending. I used the <install> rather than <vote> stats from Ubuntu in this table, but it shows a growth spurt in Bazaar and Mercurial starting in 2011. Nonetheless, bzr was behind git in 2011, but the recent stats for 2011 show that it passed git in total installed instances (on Ubuntu).

        June    Aug     Dec     Growth  Oct   Growth
        2010    2011    2011            2013 
----    -----   ----    ----    ------  ----  ------
git      94k    159k    171k      80%   165k   -3.5%
bzr      52k    121k    135k     160%   170k   26.0%
hg       36k     68k     75k     110%    95k   26.7%

Discalaimer: I used bzr on Ubuntu until 2012 when I worked on teams that used git exclusively. Bzr plays nice with all other VCSes, allowing you to use consistent, intuitive bzr command line syntax. My switch to git was for social rather than technical reasons.

查看更多
叛逆
3楼-- · 2019-01-03 01:25

Going by the number of questions on this site for these three distributed version control systems, it seems like Git either

  1. is more popular, or
  2. is more difficult (hence requiring more questions), or
  3. has more features (hence requiring more questions).
  1. About SCM popularity -- see the following StackOverflow question: Are there any popularity / usage statistics available for the Free RCS/SCM/VCS systems?. Here we have questions like what set of ignore files to use for specific kind of project, which are SCM agnostic, but are asked for Git (and using 'git' tag), because it is what person who asked question use.

  2. About Git being more difficult (and therefore having more questions about on SO) -- certainly Git has steeper learning curve. It also uses few (quite) unique concepts, like the staging area (the index), or all branches being equal, which are responsible for its power, but might be difficult to get right at first (especially if one comes from other SCM). Also Git UI is not completely consistent (although it gets better), because it was grown rather than developed; which is responsible for its power, but might lead to suboptimal user interface.

  3. About Git having more features -- you would have to check how many SO questions are about advanced / uncommon features of Git. You should be aware however that open source projects borrow ideas from one another, or have similar features developed independently: one example would be finding bugs by bisecting (searching) history for commit that introduced the bug which was (as far as I know) developed first in Git, and then implemented as plugin in Bazaar, and first extension and currently core functionality in Mercurial. Another would be interactive selecting fragments of changes to commit, inspired by Darcs behaviour. Yet another would be Git's bundle idea, borrowed from similar concept in Mercurial.

  4. Yet another possibility of source of larger number of SO question might be lack of good documentation... although it gets better nowadays with Git User's Manual (distributed with Git) and Git Community Book (found on Git homepage). Still there is this persistent meme that Git has worse documentation than, say, Subversion with its Version Control with Subversion (also known as svnbook) and Mercurial: The Definitive Guide (also known as hg-book)... and people do not read documentation before asking question on StackOverflow, sometimes.

It's not entirely satisfactory having three competing yet largely equivalent open source products to choose from. Personally I use Git and I'm fine with the other two. But when it comes to recommending one system over the others, I'd like to ask: can we start recommending one safely yet?

Well, Git and Mercurial were developed independently starting at nearly the same time in the response of terminating free license for BitKeeper for use by Linux kernel developers, as a replacement for it. Subversion was out of the question as centralized SCM, with lack of support (then) in core for merge tracking; this made it completely unsuitable for the largely distributed development model of Linux kernel. Bazaar was probably too slow (at least then), and a bit on centralized side (I guess).

Git is more powerfull (in my opinion), Mercurial is simpler (in people opinion) and a bit more portable (Python); Git is scriptable and is based on data model allowing independent reimplementations (see e.g. JGit, git written in Java), while Mercurial has Python bindings for writing extensions, and is based largely on API allowing change of underlying repository format (revlog - revlog-ng)... but that is just my supposition. They fill slightly different niches.

Besides isn't having a choice considered good thing? We have KDE and we have GNOME and XFCE (and other window managers and desktop envirionments); we have Emacs and Vim (and other programmer's editors); we have rpm-based (e.g. Fedora Core, Mandriva, SuSE) and deb-based (Debian, Ubuntu) and tgz-based (Slackware) and source-based (Gentoo) distributions; we have KWord, AbiWord and OpenOffice.org... and we have Git, Mercurial and Bazaar.

查看更多
甜甜的少女心
4楼-- · 2019-01-03 01:28

[NOTE: With the release of Subversion 1.7, the first paragraph in my answer below is out of date, as Subversion now just creates a single ".svn" folder in the base folder, similar to the others now.]

One advantage of any of the three over subversion is that it doesn't create an equivalent of a ".svn" folder in every folder of the project. Usually just has one (".hg", ".bzr" or ".git") in the base folder. That alone can be a good reason to use one of them over svn even if you are using a centralised repository model. (Aside: In fact, I often use svk as my svn client when using a svn repository just for this feature (linux only though, svk is not good on windows)).

Of course, one advantage of subversion is you don't have to check-out the entire project if you only need one of its sub-folders.

查看更多
欢心
5楼-- · 2019-01-03 01:29

I use and recommend mercurial

  • rather than subversion because it supports distributed development. I can work on several machines and commit locally. You can't do this with subversion, at least not without somersaults like additional repositories
  • rather than bazaar because bazaar's windows support is ... well.
  • rather than git because it is a) simpler to learn and use and b) windows support is much better
查看更多
倾城 Initia
6楼-- · 2019-01-03 01:32

Check the following link to a poll on the subject:

http://www.debian-administration.org/polls/160

查看更多
登录 后发表回答