title: Custom Git command dies from signal 13 (SIGPIPE) after exec'ing git diff
body: <p>If you create a shell script in your <code>PATH</code> called <code>git-mydiff</code> that contains:</p>
  
  <pre><code>#!/bin/bash
  exec git diff
  </code></pre>
  
  <p>and call <code>git mydiff</code> in a repository with a large amount of changes, when you quit the pager, it will output:</p>
  
  <pre><code>error: git-mydiff died of signal 13
  </code></pre>
  
  <p>However, if you execute <code>path/to/git-mydiff</code> directly, there will be no error when you exit the pager.</p>
  
  <p>Obviously one solution is to not use <code>exec</code>, but why is this a problem? Why is it only an issue when calling the script through the <code>git</code> proxy command?</p>
  
  <p>I'm using: git version 2.5.4 (Apple Git-61)</p>