title: Pre-commit hooks getting partial committed file list
body: <p>I know running git-diff and other tools can identify the changes in the repository, but when I do a partial commit, I need to pass only the committed files (rather than the entire set of files that are touched) to the pre-commit hook.</p>
  
  <p>For example, I modified three files and commit only two, and I want the pre-commit hook to know the name of the two files.</p>
  
  <pre><code>git status --porcelain
  
  M A.c 
  M B.c
  M C.h
  </code></pre>
  
  <p>then I execute:</p>
  
  <pre><code>git commit -m "two files only" A.c B.c
  </code></pre>
  
  <p>How can the pre-commit hook get hold of the list of the two files only?</p>