Skip to content

Commit

Permalink
Use git tools instead of cogito for getting the build ID
Browse files Browse the repository at this point in the history
The build ID now includes both last tagged version, commit generation
since last tagged version, as well as the leading characters of the
commit ID and a flag for dirty working tree.
(cherry picked from commit c2a0d3b)
  • Loading branch information
jonas authored and Kalle Olavi Niemitalo committed Mar 1, 2008
1 parent bb6d319 commit 705acfa
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Makefile.config.in
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ ASCIIDOC_FLAGS = @ASCIIDOC_FLAGS@
AWK = @AWK@
CATALOGS = @CATALOGS@
CC = @CC@
CG_COMMIT_ID = @CG_COMMIT_ID@
GIT = @GIT@
CONFDIR = @CONFDIR@
DOXYGEN = @DOXYGEN@
GLIBC21 = @GLIBC21@
Expand Down
2 changes: 1 addition & 1 deletion configure.in
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ AC_PATH_PROGS(AWK, "$AWK")
AC_PROG_RANLIB
AC_PROG_INSTALL

AC_PATH_PROGS(CG_COMMIT_ID, "cg-commit-id")
AC_PATH_PROGS(GIT, "git")
AC_PATH_PROGS(SPARSE, "sparse")

CONFIG_ASCIIDOC="no"
Expand Down
6 changes: 4 additions & 2 deletions src/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,10 @@ SUBDIRS = \
viewer

# Get the GIT HEAD ID if possible
ifdef CG_COMMIT_ID
BUILD_ID=$(shell GIT_DIR=$(top_srcdir)/.git $(CG_COMMIT_ID) 2> /dev/null)
ifdef GIT
GITDESC = $(shell $(GIT) --git-dir=$(top_srcdir)/.git describe 2>/dev/null)
WTDIRTY = $(shell $(GIT) --git-dir=$(top_srcdir)/.git diff-index HEAD 2>/dev/null)
BUILD_ID = $(subst elinks-,,$(GITDESC))$(if $(WTDIRTY),-dirty)
endif
INCLUDES += -DBUILD_ID="\"$(BUILD_ID)\""

Expand Down

0 comments on commit 705acfa

Please sign in to comment.