Faster would be:
stat = "!echo Number of revisions: $(git rev-list --count HEAD)"
This avoids log having to pull out information about each commit getting git to count the commits, and avoids having to to the word-count. rev-list
also has a neat version range feature:
Another special notation is "…" which is useful for merges. The resulting set of commits is the symmetric difference between the two operands. The following two commands are equivalent:
$ git rev-list A B --not $(git merge-base --all A B)
$ git rev-list A...B
rev-list is a very essential Git command, since it provides the ability to build and traverse commit ancestry graphs.
This can be used to update your alias so that it will give you the revisions on a particular branch since it was forked or merged.