I'm trying to run this couple of lines to get the git commit in a makefile, outside of any recipe
GIT_VERSION := $(shell cd "C:\Users\made\up\filepath" && git describe --always)
$(info GIT_VERSION is '$(GIT_VERSION)')
But it always prints GIT_VERSION is ''
However, if I run
PWD := $(shell cd "C:\Users\made\up\filepath" && pwd)
$(info PWD is $(PWD))
it prints out PWD is /cygdrive/c/Users/made/up/filepath
as I might expect.
This led me to think there was something wrong with the shell the makefile was using. SHELL := $(shell echo $$SHELL)
gives /bin/bash
, which I note is different from the /usr/bin/bash
that opening a git-bash shell gives me, although I'm not sure how to interpret this, being on Windows. Any clue how I can start getting some output from the git
call?
update: still struggling with this. Have tried the -C
git option as reccommended in comments, wrapping in eval, still getting nothing in GIT_VERSION