Staging
v0.5.2
https://github.com/git/git
Revision d661146ac2ada526e80dbb6234f8f8da6642ffcb authored by Jakub Narebski on 29 January 2008, 19:52:32 UTC, committed by Junio C Hamano on 30 January 2008, 06:01:20 UTC
Those two configuration variables are important enough that it is
worth to explicitely write about them in the "Gitweb config file
variables" section even if they are usually set during build by
GITWEB_PROJECTROOT and GITWEB_LIST build (Makefile) configuration
variables.

Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
1 parent a5d86f7
Raw File
Tip revision: d661146ac2ada526e80dbb6234f8f8da6642ffcb authored by Jakub Narebski on 29 January 2008, 19:52:32 UTC
gitweb: Add info about $projectroot and $projects_list to gitweb/README
Tip revision: d661146
GIT-VERSION-GEN
#!/bin/sh

GVF=GIT-VERSION-FILE
DEF_VER=v1.5.4-rc5.GIT

LF='
'

# First see if there is a version file (included in release tarballs),
# then try git-describe, then default.
if test -f version
then
	VN=$(cat version) || VN="$DEF_VER"
elif test -d .git &&
	VN=$(git describe --abbrev=4 HEAD 2>/dev/null) &&
	case "$VN" in
	*$LF*) (exit 1) ;;
	v[0-9]*) : happy ;;
	esac
then
	VN=$(echo "$VN" | sed -e 's/-/./g');
else
	VN="$DEF_VER"
fi

VN=$(expr "$VN" : v*'\(.*\)')

dirty=$(sh -c 'git diff-index --name-only HEAD' 2>/dev/null) || dirty=
case "$dirty" in
'')
	;;
*)
	VN="$VN-dirty" ;;
esac

if test -r $GVF
then
	VC=$(sed -e 's/^GIT_VERSION = //' <$GVF)
else
	VC=unset
fi
test "$VN" = "$VC" || {
	echo >&2 "GIT_VERSION = $VN"
	echo "GIT_VERSION = $VN" >$GVF
}


back to top