parameters: (commits, files)
return_statement: return p
docstring: Return a subprocess object producing the diff from `commits`.
  
    The return value's `stdin` file object will produce a patch with the
    differences between the working directory and the first commit if a single
    one was specified, or the difference between both specified commits, filtered
    on `files` (if non-empty).  Zero context lines are used in the patch.
docstring_summary: Return a subprocess object producing the diff from `commits`.
docstring_tokens: Return a subprocess object producing the diff from commits .
function: def compute_diff(commits, files):
    """Return a subprocess object producing the diff from `commits`.
  
    The return value's `stdin` file object will produce a patch with the
    differences between the working directory and the first commit if a single
    one was specified, or the difference between both specified commits, filtered
    on `files` (if non-empty).  Zero context lines are used in the patch."""
    git_tool = 'diff-index'
    if len(commits) > 1:
      git_tool = 'diff-tree'
    cmd = ['git', git_tool, '-p', '-U0'] + commits + ['--']
    cmd.extend(files)
    p = subprocess.Popen(cmd, stdin=subprocess.PIPE, stdout=subprocess.PIPE)
    p.stdin.close()
    return p
function_tokens: def compute_diff ( commits , files ) : git_tool = 'diff-index' if len ( commits ) > 1 : git_tool = 'diff-tree' cmd = [ 'git' , git_tool , '-p' , '-U0' ] + commits + [ '--' ] cmd . extend ( files ) p = subprocess . Popen ( cmd , stdin = subprocess . PIPE , stdout = subprocess . PIPE ) p . stdin . close ( ) return p