Tuplanolla Sampsa Kiiskinen


Silly metrics for a silly question.

The Usability of Git

Let us compare the usability of Git to another popular system with bad documentation: Python. We use the popularity of top questions on Stack Overflow as a metric to see how easy common problems are to solve.

We only need to do some basic text processing with wget and xmllint.

for x in git python
do wget -O "$x.html" "http://stackoverflow.com/questions/tagged/$x?sort=votes&pageSize=25" && \
   echo cat "//div[@id='questions']//div[@class='votes']/span/strong/text()|//div[@id='questions']//div[@class='summary']/h3/a/text()" | \
   xmllint --html --shell "$x.html" | \
   grep -v '^ -\+$' | \
   paste -sd '\t\n' | \
   column -s "$(printf '\t')" -t > "$x.text"

The results for Git are focused on undo.

7690  Edit an incorrect commit message in Git
7349  How do you undo the last commit?
5424  Delete a Git branch both locally and remotely
4677  What are the differences between 'git pull' and 'git fetch'?
3650  Undo 'git add' before commit
2687  How do you rename the local branch?
2674  How do I remove local (untracked) files from my current Git branch?
2578  Fix merge conflicts in Git?
2457  Revert to a previous Git commit
2263  Clone all remote branches with Git?
2182  Checkout remote Git branch
2117  Force Git to overwrite local files on pull
1935  How do I remove a Git submodule?
1843  Make an existing Git branch track a remote branch?
1791  How can I add an empty directory to a Git repository?
1655  How do you discard unstaged changes in git?
1589  Move the most recent commit(s) to a new branch with Git
1533  Do a "git export" (like "svn export")?
1480  How do you create a remote Git branch?
1473  Undo a Git merge?
1438  Change the URI (URL) for a remote Git repository
1429  Push a new local branch to a remote Git repo and track it too
1378  Reset or revert a specific file to a specific revision using Git?
1358  Delete commits from a branch in Git
1297  Find and restore a deleted file in a Git repo

The results for Python are mostly about system calls and implementation details.

3721  What does the yield keyword do in Python?
2351  What is a metaclass in Python?
1765  Check whether a file exists using Python
1647  Does Python have a ternary conditional operator?
1561  Calling an external command in Python
1535  How can I make a chain of function decorators in Python?
1239  What does `if __name__ == "__main__":` do?
1226  How to install pip on Windows?
1215  How can I merge two Python dictionaries in a single expression?
1174  Sort a Python dictionary by value
1148  How can I represent an 'Enum' in Python?
1125  Using global variables in a function other than the one that created them
1097  In Python, check if a directory exists and create it if necessary
1071  "Least Astonishment" in Python: The Mutable Default Argument
1067  What is the difference between @staticmethod and @classmethod in Python?
1062  Best way to check if a list is empty
1062  Is there a way to run Python on Android?
1032  What IDE to use for Python?
1030  How do I pass a variable by reference?
956   Understanding Python super() with __init__() methods
951   Python - append vs. extend
937   Accessing the index in Python for loops
923   Difference between __str__ and __repr__ in Python
909   Does Python have a string contains method?
847   Add key to a dictionary in Python?

Draw your own conclusions.