title: Jenkins using Git Plugin not populating GIT_COMMIT to promoted build
body: <p>I am trying to set up a series of jobs in Jenkins to build and deploy an application using the Promoting plug in. We are currently using Git as our SCM and we are using the Git Plug in to help with the builds. This particular build is a Maven build. The steps I am trying to implement is as follows:</p>
  
  <ul>
  <li>A build job that compiles, runs unit test and creates artifacts. This
  job fires on code commit. </li>
  <li>The build job has a manual promotion point
  to deploy this code into our test environment. The promotion point
  has an approval parameter to pass the environment to be used for the
  deployment. </li>
  <li>The promotion point triggers a job, let's call it the
  Integration job, which only triggers several deployment jobs, some of
  these deployment jobs require to get from Git the same code that was
  used for building the artifacts. Since the code may have changed from
  the moment this particular release was built to the moment we want
  to do the deployment, I am trying to use the GIT_COMMIT environment
  variable to propagate the commit number used to build the artifacts.</li>
  <li>In the Integration job, in the build step that triggers the specific
  deployment job, I am not adding any parameters at all, not the Git,
  not the "current build" ones.</li>
  </ul>
  
  <p>The problem is  the deployment job never gets the GIT_COMMIT value. So it is always failing while trying to retrieve the code from Git.</p>
  
  <ul>
  <li>On the build job, in the promotion process, besides the Approval parameter to select the environment, in the Action triggering the integration job I have added the "Current build parameters" and "Pass-through Git Commit that was built" parameters.</li>
  <li>On the build job, after it runs I can see the environment variables for the job and the GIT_COMMIT variable has the proper value for the commit.</li>
  <li>On the integration job I don't see the GIT_COMMIT in the environment variables list.</li>
  <li>On the deployment job I don't see the GIT_COMMIT in the environment variables list.</li>
  </ul>
  
  <p>So far I have tried:</p>
  
  <ul>
  <li>Add "Current build parameters" and "Pass-through Git Commit that was built" to the trigger to the deployment job</li>
  <li>Adding another variable in the Build job and assign it the $GIT_COMMIT as a value</li>
  <li>Adding another variable as an Approval parameter for the promotion and give it $GIT_COMMIT value</li>
  <li>Adding another variable in the Trigger for the Integration job and give it $GIT_COMMIT value</li>
  <li>Adding a parameter to the deployment job and default it to $GIT_COMMIT, but overriding said parameter with the value from the trigger.</li>
  </ul>
  
  <p>So far, no luck.</p>
  
  <p>I must add that all the other parameters and variables are propagating properly, the Deployment environment one, I have one for versioning, BUILD_NUMBER, etc. everything propagates well, except for GIT_COMMIT.</p>
  
  <p>I also have a similar setup for another application, this is a Grails application, and the GIT_COMMIT propagates perfectly fine there.</p>
  
  <p>These are the versions I am using:</p>
  
  <ul>
  <li>Jenkins         1.632 </li>
  <li>Git Plugin       2.4.0</li>
  <li>Promoted Builds (Simple)    1.9</li>
  <li>promoted builds plugin      2.24</li>
  <li>Java Open JDK   1.7.0_75</li>
  </ul>
  
  <p>Any ideas are more than welcome. Thank you.</p>