title: Git:How to commit changed file content done from commit_msg hook
body: <p>Objective: 
  (1) The git commit message (with -m switch, or using a editor) has to be put in the<br>
  committed file. We have a comment block at the start of each source file, 
  which has these commit messages in a line in a particular format.</p>
  
  <p>Problem in implementation:
  (2) I have a commit_msg hook script where I insert the commit comments by the user 
  to the committed files (in the starting comment block). 
  But after the commit the files are again marked as modified. 
  When I do a diff I see the last changes I made to the file from my hook script, 
  are the modification, which did not get committed. </p>
  
  <p>Is there a git command option which will let me amend the commit changes, 
  which I made from the commit_msg hook?</p>
  
  <p>I thought I cannot use pre-commit and prepare-commit-msg hooks, because, I need the users
  commit comments, which he puts using the popped up editor at the time of commit, 
  or from the -m switch. This action happens after the above 2 hooks are called,
  so my only option was commit-msg, post-commit hook is too late.</p>
  
  <p>Any help is appreciated. </p>
  
  <p>Thanks
  sguha.</p>