def _git_diff_name_status(left, right, diff_filter=''):
 git_cmd = ['git', 'diff', '--name-status']
 if diff_filter:
  git_cmd.append('--diff-filter={}'.format(diff_filter))
 git_cmd.extend([left, right])
 (out, err) = _start_subprocess_for_result(git_cmd)
 if (not err):
  file_list = []
  for line in out.splitlines():
   file_list.append(FileDiff(line[0], line[(line.rfind(' DCTB ') + 1):]))
  return file_list
 else:
  raise ValueError(err)

def _git_diff_name_status ( left , right , diff_filter = '' ) : git_cmd = [ 'git' , 'diff' , '--name-status' ] if diff_filter : git_cmd . append ( '--diff-filter={}' . format ( diff_filter ) ) git_cmd . extend ( [ left , right ] ) ( out , err ) = _start_subprocess_for_result ( git_cmd ) if ( not err ) : file_list = [ ] for line in out . splitlines ( ) : file_list . append ( FileDiff ( line [ 0 ] , line [ ( line . rfind ( ' DCTB ' ) + 1 ) : ] ) ) return file_list else : raise ValueError ( err )
compare two branches/commits etc with git .