On Wed, Mar 23, 2022 at 03:19:06PM +0000, John Garry wrote: > For building the linux perf tool we use the git head commit id as part of > the tool version sting. To save time in re-building, the Makefile rule has a > dependency on .git/HEAD for rebuilding. An alternative approach would be to > compare git log output to check current versus previous build head commit, > but that is seen as inefficient time-wise. Having a Makefile recipe that depends on $GIT_DIR/HEAD seems strange to me. Presumably your Makefile rules would map out which parts of your program depend on each other, and would get invalidated when the source itself changes, no? Perhaps you also care about the commit you're building from in order to embed something into your program. But it seems like you could inject the output of "git rev-parse HEAD" when you construct the version identifier whenever you do need to rebuild. Thanks, Taylor