Lines Matching +full:- +full:- +full:git
3 scriptversion=2012-09-25.20
5 # Copyright (C) 2007-2008 Free Software Foundation
20 # This script is derived from GIT-VERSION-GEN from GIT: http://git.or.cz/.
22 # - from a git repository in which the "git describe" command below
24 # - from a non-git-repo directory containing a .tarball-version file, which
25 # presumes this script is invoked like "./git-version-gen .tarball-version".
27 # In order to use intra-version strings in your project, you will need two
30 # .tarball-version - present only in a distribution tarball, and not in
31 # a checked-out repository. Created with contents that were learned at
32 # the last time autoconf was run, and used by git-version-gen. Must not
33 # be present in either $(srcdir) or $(builddir) for git-version-gen to
40 # .version - present in a checked-out repository and in a distribution
51 # automatically be up-to-date each time configure is run (and note that
56 # m4_esyscmd([build-aux/git-version-gen .tarball-version]),
57 # [bug-project@example])
60 # will be present for dependencies, and so that .tarball-version will
65 # echo $(VERSION) > $@-t && mv $@-t $@
66 # dist-hook:
67 # echo $(VERSION) > $(distdir)/.tarball-version
72 *) echo 1>&2 "Usage: $0 \$srcdir/.tarball-version"; exit 1;;
80 # First see if there is a tarball-only version file.
81 # then try "git describe", then default.
82 if test -f $tarball_version_file
86 *$nl*) v= ;; # reject multi-line output
87 [0-9]*)
88 echo "$v" | tr -d '\012'
93 test -z "$v" \
97 # This is presently used by the GNOME-OSTree build system; it
98 # helps support the case where the meta-build system has already
99 # determined the git revision, but we may not be able to run "git describe"
101 if test -n "$GIT_DESCRIBE_FOR_BUILD";
106 if test -n "$v"
109 elif test -e .git \
110 && v=`git describe --abbrev=4 --match='v[0-9]*' HEAD 2>/dev/null` \
111 && [ -n "$v" ]
121 v2=`git describe --abbrev=4 --match='v[0-9]\.[0-9]' --contains $v 2>/dev/null | cut -d'^' -f1`
122 [ -n "$v2" ] && v=$v2
124 # Is this a new git that lists number of commits since the last
126 # Newer: v6.10-77-g0f8faeb
127 # Older: v6.10-g0f8faeb
129 # *-*-*) : git describe is okay three part flavor ;;
130 # *-*)
131 # : git describe is older two part flavor
134 # # of git describe.
135 # vtag=`echo "$v" | sed 's/-.*//'`
136 # numcommits=`git rev-list "$vtag"..HEAD | wc -l`
137 # v=`echo "$v" | sed "s/\(.*\)-\(.*\)/\1-$numcommits-\2/"`;
141 # Change the first '-' to a '.', so version-comparing tools work properly.
142 # Remove the "g" in git describe's output string, to save a byte.
143 # v=`echo "$v" | sed 's/-/./;s/\(.*\)-g/\1-/'`;
146 echo 1>&2 "$0: Failed to determine git revision"
153 git status > /dev/null 2>&1
155 dirty=`sh -c 'git diff-index --name-only HEAD' 2>/dev/null` || dirty=
160 *-dirty) ;;
161 *) v="$v-dirty" ;;
166 echo "$v" | tr -d '\012'
169 # eval: (add-hook 'write-file-hooks 'time-stamp)
170 # time-stamp-start: "scriptversion="
171 # time-stamp-format: "%:y-%02m-%02d.%02H"
172 # time-stamp-end: "$"