Skip to content

Commit

Permalink
Move fall-back version string to Makefile
Browse files Browse the repository at this point in the history
  • Loading branch information
jonas committed Apr 30, 2012
1 parent e6cf79e commit 0a0f618
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
## Makefile for tig

# The last tagged version. Can be overridden either by the version from
# git or from the value of the DIST_VERSION environment variable.
VERSION = 0.18

all:

# Include setting from the configure script
Expand All @@ -13,14 +17,10 @@ docdir ?= $(datarootdir)/doc
mandir ?= $(datarootdir)/man
# DESTDIR=

# Get version either via git or from VERSION file. Allow either
# to be overwritten by setting DIST_VERSION on the command line.
ifneq (,$(wildcard .git))
GITDESC = $(subst tig-,,$(shell git describe))
WTDIRTY = $(if $(shell git diff-index HEAD 2>/dev/null),-dirty)
VERSION = $(GITDESC)$(WTDIRTY)
else
VERSION = $(shell test -f VERSION && cat VERSION || echo "unknown-version")
endif
ifdef DIST_VERSION
VERSION = $(DIST_VERSION)
Expand Down
1 change: 0 additions & 1 deletion VERSION

This file was deleted.

3 changes: 2 additions & 1 deletion contrib/release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# Script for preparing a release or updating the release branch.
# Usage: $0 version
#
# Copyright (c) 2009-2010 Jonas Fonseca <fonseca@diku.dk>
# Copyright (c) 2009-2012 Jonas Fonseca <fonseca@diku.dk>
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
Expand Down Expand Up @@ -34,6 +34,7 @@ if test -n "$VERSION"; then

# Update files which should reference the version.
echo "$VERSION" > VERSION
sed -i "s/VERSION\s=\s[0-9]\+[.][0-9]\+/VERSION = $VERSION/" Makefile
perl -pi -e 's/^tig master.*/@@TITLE@@/ms' NEWS
perl -pi -e "s/^@@TITLE@@.*/$TITLE/" NEWS

Expand Down

0 comments on commit 0a0f618

Please sign in to comment.