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 driver into the version string printed out during the module load. The Makefile computes the git hash using the command
DRV_TAG := $(shell git log -1 --pretty=format:"%h")
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?
This is using git 1.5.4.5 and Linux 2.6.28