def _get_revno(git_dir):
 describe = _run_shell_command(('git --git-dir=%s describe --always' % git_dir))
 if ('-' in describe):
  return describe.rsplit('-', 2)[(-2)]
 revlist = _run_shell_command(('git --git-dir=%s rev-list --abbrev-commit HEAD' % git_dir))
 return len(revlist.splitlines())

def _get_revno ( git_dir ) : describe = _run_shell_command ( ( 'git --git-dir=%s describe --always' % git_dir ) ) if ( '-' in describe ) : return describe . rsplit ( '-' , 2 ) [ ( - 2 ) ] revlist = _run_shell_command ( ( 'git --git-dir=%s rev-list --abbrev-commit HEAD' % git_dir ) ) return len ( revlist . splitlines ( ) )
return the number of commits since the most recent tag .