title: git commit hash of an external loadable module
body: <p>I'm developing a Linux kernel module outside of the Linux source tree (in the standard way) and am trying to automatically include the git commit hash of the <strong>driver</strong> into the version string printed out during the module load. The Makefile computes the git hash using the command</p>
  
  <pre><code>DRV_TAG   := $(shell git log -1 --pretty=format:"%h")
  </code></pre>
  
  <p>but this picks up the git hash of the Linux tree and not my driver. Can you tell git to look at a particular directory when executing commands, or alternatively, is there is a better way of approaching this problem?</p>
  
  <p>This is using git 1.5.4.5 and Linux 2.6.28</p>