def get_git_revision():
 logger = logging.getLogger(__name__)
 if (not check_executable('git')):
  logger.warning("'git' command not found, git revision not detectable")
  return None
 output = subprocess.check_output(['git', 'rev-parse', 'HEAD']).strip()
 if (not output):
  logger.warning("Couldn't detect git revision (not a git repository?)")
  return None
 return output

def get_git_revision ( ) : logger = logging . getLogger ( __name__ ) if ( not check_executable ( 'git' ) ) : logger . warning ( "'git' command not found, git revision not detectable" ) return None output = subprocess . check_output ( [ 'git' , 'rev-parse' , 'HEAD' ] ) . strip ( ) if ( not output ) : logger . warning ( "Couldn't detect git revision (not a git repository?)" ) return None return output
return git revision for the repository located at repopath result is a tuple .