[gimp] app: generate git-version.h regardless of branch



commit 222ffd2360b80652ebffc44b5a00d1bfddf859d8
Author: Nils Philippsen <nils redhat com>
Date:   Fri Jul 9 16:37:30 2010 +0200

    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.

 app/Makefile.am |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/app/Makefile.am b/app/Makefile.am
index 1662d5e..cd94001 100644
--- a/app/Makefile.am
+++ b/app/Makefile.am
@@ -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



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]