title: pre-commit hook changed files to be added to commit
body: <p>I am writing a pre-commit hook for my repositories to format the code according to coding standards.</p>
  
  <pre><code>npm install
  ./node_modules/.bin/eslint --fix ./index.js
  </code></pre>
  
  <p>The above line is part of my hook. It is working as I wanted it and changed the index.js file to standard format with clean code.  After successful commit, when I did <strong>git status</strong> I see a unstaged change which is the change made by pre-commit hook in the recent commit. </p>
  
  <p>I am looking for a way where all the changes done by the pre-commit hook to be included in the present commit without having to commit again.  So, the flow should be as</p>
  
  <ol>
  <li>git commit</li>
  <li>Pre-commit hook runs, changes the files if necessary, adds the changes to the present commit</li>
  <li>Now, I can just push</li>
  </ol>