code: def current_id(self):
          
          try:
              cmd = ['git', 'rev-parse', '--short', 'HEAD']
              return self.sh(cmd,
                          shell=False,
                          ignore_error=True).rstrip()
          except subprocess.CalledProcessError as e:
              log.exception(e)
              #if e.returncode == 128  # bare repo
              return None
docs: Determine the current revision identifier for the working directory
          of this Repository
  
          Returns:
              str: git HEAD revision identifier
                  (``git rev-parse --short HEAD``)