title: Git: want to iterate through all commits on branch, and list files in each commit
body: <p>I need to write a script that will</p>
  
  <ol>
  <li>iterate through all of the commits on a branch, starting from the most recent</li>
  <li>for each commit, iterate through all of the files in the commit</li>
  <li>if it finds a file of type hbm.xml, store the commit to file and exit.</li>
  </ol>
  
  <p>I have a script for step 2:</p>
  
  <pre><code>for i in `git show --pretty="format:" --name-only SHA1 | grep '.*\.hbm\.xml' `; do
      # call script here.....
      exit
  done
  </code></pre>
  
  <p>Now, I need to figure out step 1.  </p>