title: How to generate git sha1 of current repository
body: <p>I am trying to generate the current git sha1 of a repository. 
  I don't want the last commit sha1 that can be generated using a set of git command. I want the sha1 that will be used in the next commit (obviously if files are not changed).</p>
  
  <p>I would like to be able to generate an header file containing a define of the sha1 repository. This will allows me to match executable with relative git commit and viceversa.</p>
  
  <p>The problem is that not every executable is created with a stable commit (especially during development phase). </p>
  
  <p>For this reason I choose to include both:
  - Last commit sha1
  - Current repository sha1 </p>
  
  <p>If they match it means that the current  executable is created using a stable commit. Otherwise it means that you can just know what is the starting commit of your executable.   </p>
  
  <p>Can someone help me?</p>