Top Ten (Mercurial) Commands

Since Mercurial took top spot in the top ten commands post, I though it might be interesting to take a look at the break down of which Mercurial sub-commands I end up using:

aaron@ares ~$ history | grep hg | awk '{print $3}' | sort | uniq -c | sort -rn | head
  97 st
  21 commit
  20 push
  14 addremove
   8 diff
   7 qrefresh
   4 qnew
   4 qfinish
   3 up
   3 revert

hg st takes the top spot, indicating that "What the hell have I changed?" is a pretty important question to have answered. The fact that hg commit and hg push are at the top while hg pull is nowhere to be seen is a bit of an anomaly due to the fact that I'm the only one working on the repositories in question. I would expect the results to be very different if you did the same experiment on my work machine. The hg q* are all commands that are part of the Mercurial Queues extension that I use for shaping my changesets and rewriting history.

Extensions

I make pretty heavy use of both the Mercurial Queues and Rebase extensions. In tandem, they give me the ability to make my changesets to be exactly what I want them to be and to move my local branches to tip before I push (which I use so that I don't have to add trivial merge changesets). My workflow has a tendecy to look like this:

$ # do work
$ hg qnew -f -m "A pithy commit message bugzid: 1234567" a_patch.diff
$ hg qpush -a
applying first.diff
now at: first.diff
$ hg pull --rebase
pulling from /a/repository
searching for changes
adding changesets
adding manifests
adding file changes
added 1 changesets with 1 changes to 1 files
$ hg qpop
popping first.diff
now at: a_patch.diff
$ hg qfinish -a
$ hg push
pushing to /a/repository
searching for changes
adding changesets
adding manifests
adding file changes
added 1 changesets with 1 changes to 1 files
$ hg qpush
applying first.diff
now at: first.diff
$ # do more work
$ hg qrefresh
$ hg pull --rebase
pulling from /a/repository
searching for changes
no changes found
$ hg qfinish -a
$ hg push
pushing to /a/repository
searching for changes
adding changesets
adding manifests
adding file changes
added 1 changesets with 1 changes to 1 files

Sure, I could live in the world of hg fetch and type fewer commands, but I feel like having nice atomic changesets, commit messages without typos and a nice clean history is worth the extra typing.

Top Ten Commands (redux)

A few years ago I posted a list of the top ten commands I use gleaned by parsing the output of history. Here's the origional list ca. 2008:

aaron@athena ~$ history | awk '{print $2}' | sort | uniq -c | sort -rn | head
 134 ls
  90 svn
  77 cd
  16 sudo
  15 gvim
  12 rm
  11 script/server
  11 hg
  10 mongrel_rails
   7 slocate

... and here's the new list ca. 2010:

aaron@ares ~$ history | awk '{print $2}' | sort | uniq -c | sort -rn | head
 198 hg
  59 paver
  41 ls
  36 ./blogc
  33 cd
  26 python
  19 gvim
  14 fab
  12 rm
  12 ./dist/sassey

And the winner is...

The big change is that Mercurial has completely replaced Subversion as my version control system of choice. Not only that, but I actually use hg more than I used to use svn. Part of this is that hg is better/faster/easier/more useful than svn and part of it is that I've really gotten in the habit of using Mercurial for everything (which you might argue is a consequence of that first thing ;-).

I've started using Paver and Fabric and they are both awesome. I've stopped using Rails, but I was only really using it for school (My current "web framework" of choice is CherryPy, it is also awesome).

./blogc which takes the number four sport, is one of the new tools that I use to work on my blog.

Other than that, I still use gvim, rm, ls, and cd. Shocking!

An Entertaining Meme

An entertaining meme

$ history | awk '{print $2}' | sort | uniq -c | sort -rn | head
134 ls
90 svn
77 cd
16 sudo
15 gvim
12 rm
11 script/server
11 hg
10 mongrel_rails
7 slocate