title: git blame deleted file, automatically
body: <p>It is a common question how to run <code>git blame</code> on a file which has earlier been deleted (with <code>git rm</code>).  If you just run it with the old filename then it gives the same error as for a file which has never existed:</p>
  
  <pre><code>% git init
  % echo 1 &gt;a
  % git add a
  % git commit -m.
  % echo 2 &gt;a
  % git add a
  % git commit -m.
  % git rm a
  % git commit -m.
  % git blame a
  fatal: cannot stat path 'a': No such file or directory
  % git blame z
  fatal: cannot stat path 'z': No such file or directory
  </code></pre>
  
  <p>(The responses printed by git to the earlier commands have been omitted to keep things concise.)</p>
  
  <p>A common solution is to look at <code>git log --stat</code> to find the revision in which the file was removed.  You can then pass the parent of that revision to <code>git blame</code>:</p>
  
  <pre><code>% git blame 11144~1 -- a
  97da6499 (Ed Avis 2016-01-14 11:00:40 +0000 1) 2
  </code></pre>
  
  <p>This works but it is cumbersome to manually search through the log like this.  Is there no way to tell git 'I want to look at whatever files used to be called <code>a</code> in any past revision'?  I am hoping for something straightforward like</p>
  
  <pre><code>% git blame --any-file-named a
  </code></pre>
  
  <p>which would automatically check the whole history of the repository for files with that name.</p>