File: get-revision.sh

package info (click to toggle)
springlobby 0.255%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 14,228 kB
  • ctags: 14,450
  • sloc: cpp: 76,178; ansic: 61,718; python: 863; sh: 654; perl: 238; xml: 52; makefile: 41; sed: 16
file content (21 lines) | stat: -rwxr-xr-x 594 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#!/usr/bin/env bash
#
# Usage: $(basename $0) [PROJECTROOT]
#
# Determine a revision or version string to use for the current source
# tree.

# First argument, if given, is the location of the project root.  Set
# here any environment variables for VCs that care about the project
# root.
if test x"$1" != x; then
    export GIT_DIR="$1/.git"
else
    export GIT_DIR="$(dirname $0)/../.git"
fi

# It's actually this simple.  We might want to keep the script around in
# case we want to re-introduce subversion compatibility.
#i needed to get rid of extra newline
git describe --tags || exit 1