app: generate git-version.h regardless of branch

Previously, git-version.h always recorded the latest commit on the
master branch. This change should record the current commit (which is
what gets built) regardless of the branch.

I've checked that it does "the right thing" regarding multi-parent
merges by checking out such a merge commit, generating git-version.h and
comparing it to the commit sha1 in the log.
This commit is contained in:
Nils Philippsen 2010-07-09 16:37:30 +02:00
parent 6909fd5dc3
commit 222ffd2360
1 changed files with 1 additions and 1 deletions

View File

@ -281,7 +281,7 @@ gimp-console.rc.o: gimp.rc
# in which case the git-version.h we ship is correct.
git-version.h: update-git-version-header
@if test -d "$(top_srcdir)/.git"; then \
echo "#define GIMP_GIT_VERSION \"`git show-ref --hash refs/heads/master`\"" > "$@.tmp"; \
echo "#define GIMP_GIT_VERSION \"`git log -n1 --reverse --pretty=%H`\"" > "$@.tmp"; \
elif test ! -f "$@"; then \
echo "#define GIMP_GIT_VERSION \"Unknown, shouldn't happen\"" > "$@.tmp"; \
fi