mirror of
https://git.openafs.org/openafs.git
synced 2025-01-18 23:10:58 +00:00
83c6b5f79f
Only new git versions reognize the --ignore-submodules option to
diff-index and diff-files. Do not pass this, to make git-version more
likely to work across different versions, as we don't have any
submodules in the tree anyway.
Reviewed-on: http://gerrit.openafs.org/3627
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit 60322b4675
)
Change-Id: Iae527081b431863fa1eae418b8468741f75f3f2e
Reviewed-on: http://gerrit.openafs.org/3817
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
33 lines
650 B
Bash
Executable File
33 lines
650 B
Bash
Executable File
#!/bin/sh
|
|
|
|
srcdir=$1
|
|
fallback=$2
|
|
|
|
if [ "x$fallback" = "x" ]; then
|
|
fallback=UNKNOWN
|
|
fi
|
|
|
|
if [ -f $srcdir/.version ] ; then
|
|
git_version=`cat $srcdir/.version`
|
|
else
|
|
if which git > /dev/null; then
|
|
cd $srcdir
|
|
git_version=`git describe --abbrev=4 HEAD 2>/dev/null`
|
|
if [ $? = 0 ]; then
|
|
# Is the working tree dirty?
|
|
if git diff-index --quiet --cached HEAD && \
|
|
git diff-files --quiet ; then
|
|
:
|
|
else
|
|
git_version="$git_version-dirty"
|
|
fi
|
|
else
|
|
git_version=$fallback
|
|
fi
|
|
else
|
|
git_version=$fallback
|
|
fi
|
|
fi
|
|
|
|
echo "$git_version" | sed -e 's/openafs-[^-]*-//' -e 's/_/./g' | tr -d '\012'
|