original_docstring: Status of the repo or of the only_paths given.
  
    Returns:
      A list of (fp, status) pairs. fp is a file path and status is a two or three
      letter code corresponding to the output from status porcelain and ls-files
      (see git manual for more info).
    
docstring: Status of the repo or of the only_paths given.
docstring_tokens: Status of the repo or of the only_paths given .
code: def of(only_paths=None, relative_paths=None):
    """Status of the repo or of the only_paths given.
  
    Returns:
      A list of (fp, status) pairs. fp is a file path and status is a two or three
      letter code corresponding to the output from status porcelain and ls-files
      (see git manual for more info).
    """
    if not relative_paths:
      c = config.get('status.relativePaths')
      relative_paths = c if c else True  # git seems to default to true
  
    if only_paths:
      pathspecs = '"' + '" "'.join(only_paths) + '"'
    else:
      pathspecs = common.repo_dir()
  
    ret = {}
    repo_dir = common.repo_dir()
  
    def status_porcelain():
      out, _ = common.safe_git_call(
          'status --porcelain -u --ignored {0}'.format(pathspecs))
      for f_out in out.splitlines():
        # Output is in the form <status> <file path>.
        # <status> is 2 chars long.
        fp, s = f_out[3:], f_out[:2]
        if fp.startswith('"'):
          fp = fp[1:-1]
        if relative_paths:
          fp = os.path.relpath(os.path.join(repo_dir, fp))
        ret[fp] = s
  
    def ls_files():
      out, _ = common.safe_git_call(
          'ls-files -v --full-name -- {0}'.format(pathspecs))
      for f_out in common.remove_dups(out.splitlines(), lambda x: x[2:]):
        fp, s = f_out[2:], f_out[0]
        if relative_paths:
          fp = os.path.relpath(os.path.join(repo_dir, fp))
        if fp in ret:
          ret[fp] = ret[fp] + s
        else:
          ret[fp] = '  ' + s
  
    status_porcelain()
    ls_files()
    return common.items(ret)
code_tokens: def of ( only_paths = None , relative_paths = None ) : if not relative_paths : c = config . get ( 'status.relativePaths' ) relative_paths = c if c else True if only_paths : pathspecs = '"' + '" "' . join ( only_paths ) + '"' else : pathspecs = common . repo_dir ( ) ret = { } repo_dir = common . repo_dir ( ) def status_porcelain ( ) : out , _ = common . safe_git_call ( 'status --porcelain -u --ignored {0}' . format ( pathspecs ) ) for f_out in out . splitlines ( ) : fp , s = f_out [ 3 : ] , f_out [ : 2 ] if fp . startswith ( '"' ) : fp = fp [ 1 : - 1 ] if relative_paths : fp = os . path . relpath ( os . path . join ( repo_dir , fp ) ) ret [ fp ] = s def ls_files ( ) : out , _ = common . safe_git_call ( 'ls-files -v --full-name -- {0}' . format ( pathspecs ) ) for f_out in common . remove_dups ( out . splitlines ( ) , lambda x : x [ 2 : ] ) : fp , s = f_out [ 2 : ] , f_out [ 0 ] if relative_paths : fp = os . path . relpath ( os . path . join ( repo_dir , fp ) ) if fp in ret : ret [ fp ] = ret [ fp ] + s else : ret [ fp ] = '  ' + s status_porcelain ( ) ls_files ( ) return common . items ( ret )
short_docstring: Status of the repo or of the only_paths given.
short_docstring_tokens: Status of the repo or of the only_paths given .
comment: """Status of the repo or of the only_paths given.
  
    Returns:
      A list of (fp, status) pairs. fp is a file path and status is a two or three
      letter code corresponding to the output from status porcelain and ls-files
      (see git manual for more info).
    """$SEP$# git seems to default to true$SEP$# Output is in the form <status> <file path>.$SEP$# <status> is 2 chars long.