title: Git prepare-commit-msg
body: <p>My Code:</p>
  <pre class="lang-sh prettyprint-override"><code>COMMIT_MSG_FILE=$1
  COMMIT_SOURCE=$2
  SHA1=$3
  
  git diff --cached --name-status &gt; ./.git/test.txt
  git var GIT_COMMITTER_IDENT | sed -n 's/^\(.*&gt;\).*$/Signed-off-by: \1/p'&gt;&gt; .git/test.txt
  
  SOB=$(cat .git/test.txt)
   git interpret-trailers --in-place --trailer &quot;$SOB&quot; &quot;$COMMIT_MSG_FILE&quot;
  </code></pre>
  <p>I try to get the output of <code>git diff --cached --name-status</code> at the end of the git commit message and that works but the weird part is that if I use <code>git commit</code> and then close the file (COMMIT_EDITMSG) the commit will be committed but if I make a comment out <code>git diff --cached --name-status &gt; ./.git/test.txt</code> then the commit can be aborted through just not editing the file and that is what I try to fix but it seems to I can't any suggestions?</p>
  <p>example output is:</p>
  <pre><code>M   README.md
  Signed-off-by: NAME \&lt;E-Mail\&gt;
  </code></pre>