5 # Figure out where the git binary is.
6 .for _P in /usr/bin /usr/local/bin
7 . if !defined(GIT_CMD) || empty(GIT_CMD)
14 .if !empty(GIT_CMD) && exists(${GIT_CMD})
15 # Set the git branch and hash to export where needed.
16 . if !defined(GITBRANCH) || empty(GITBRANCH)
17 GITBRANCH!= ${GIT_CMD} -C ${.CURDIR} rev-parse --abbrev-ref HEAD 2>/dev/null | sed -e 's/\^\///'
20 . if !defined(GITREV) || empty(GITREV)
21 GITREV!= ${GIT_CMD} -C ${.CURDIR} rev-parse --verify --short HEAD 2>/dev/null || true
24 . if !defined(GITCOUNT) || empty(GITCOUNT)
25 GITCOUNT!= ${GIT_CMD} -C ${.CURDIR} rev-list --first-parent --count HEAD 2>/dev/null || true
37 # Set the build date, primarily for snapshot builds.
38 .if !defined(BUILDDATE) || empty(BUILDDATE)
39 BUILDDATE!= date +%Y%m%d