parameters: (options)
return_statement: return commit_id, commit_log, source_name, source_location
docstring: r"""
    >>> class fake_options:
    ...   source="."
    ...   verbose_mode=False
    ...   debug_mode=False
    >>> myoptions = fake_options()
    >>> find_git_commit_information(myoptions)[2:]
    ('sems', 'software.sandia.gov:/git/sems')
docstring_summary: r"""
    >>> class fake_options:
    ...   source="."
    ...   verbose_mode=False
    ...   debug_mode=False
    >>> myoptions = fake_options()
    >>> find_git_commit_information(myoptions)[2:]
    ('sems', 'software.sandia.gov:/git/sems')
docstring_tokens: r >>> class fake_options : ... source = . ... verbose_mode = False ... debug_mode = False >>> myoptions = fake_options () >>> find_git_commit_information ( myoptions ) [ 2 : ] ( sems software . sandia . gov : / git / sems )
function: def find_git_commit_information(options):
    r"""
    >>> class fake_options:
    ...   source="."
    ...   verbose_mode=False
    ...   debug_mode=False
    >>> myoptions = fake_options()
    >>> find_git_commit_information(myoptions)[2:]
    ('sems', 'software.sandia.gov:/git/sems')
    """
    git_log_cmd = ["git", "log", "-1"]
    
    output, error = run_cmd(git_log_cmd, options, options.source)
    
    commit_match = re.match("commit ([0-9a-fA-F]+)", output)
    commit_id = commit_match.group(1)
    commit_log = output
    
    git_remote_cmd = ["git", "remote", "-v"]
    output, error = run_cmd(git_remote_cmd, options, options.source)
    
    remote_match = re.search("origin\s([^ ]*/([^ ]+))", output, re.MULTILINE)
    if not remote_match:
      raise RuntimeError("Could not find origin of repo at %s. Consider using none for source repo type." % (options.source))
  
    source_location = remote_match.group(1)
    source_name     = remote_match.group(2).strip()
    
    if source_name[-1] == "/":
      source_name = source_name[:-1]
  
    return commit_id, commit_log, source_name, source_location
function_tokens: def find_git_commit_information ( options ) : git_log_cmd = [ "git" , "log" , "-1" ] output , error = run_cmd ( git_log_cmd , options , options . source ) commit_match = re . match ( "commit ([0-9a-fA-F]+)" , output ) commit_id = commit_match . group ( 1 ) commit_log = output git_remote_cmd = [ "git" , "remote" , "-v" ] output , error = run_cmd ( git_remote_cmd , options , options . source ) remote_match = re . search ( "origin\s([^ ]*/([^ ]+))" , output , re . MULTILINE ) if not remote_match : raise RuntimeError ( "Could not find origin of repo at %s. Consider using none for source repo type." % ( options . source ) ) source_location = remote_match . group ( 1 ) source_name = remote_match . group ( 2 ) . strip ( ) if source_name [ - 1 ] == "/" : source_name = source_name [ : - 1 ] return commit_id , commit_log , source_name , source_location