Count the number of commits on a branch
===

I found this answer already: http://stackoverflow.com/questions/10913892/number-of-commits-on-branch-in-git
but that assumes that the branch was created from master.

How can I count the number of commits along a branch *without* relying on that assumption?

In SVN this is trivial, but for some reason is really difficult to figure out in git.