pub fn commit_count(dir: &Path) -> Option<u64>
The number of commits reachable from HEAD (git rev-list --count HEAD), or None when not a repo or there are no commits yet.
git rev-list --count HEAD
None