mirror of
https://github.com/kdave/btrfs-progs
synced 2025-01-22 21:43:35 +00:00
Use git for version number too
Date: Tue, 19 Aug 2008 18:57:17 +0100 Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
This commit is contained in:
parent
e7e7bb1727
commit
be8c87e176
18
version.sh
18
version.sh
@ -8,7 +8,23 @@
|
||||
|
||||
v="Btrfs v0.16"
|
||||
|
||||
which hg > /dev/null
|
||||
which git &> /dev/null
|
||||
if [ $? == 0 -a -d .git ]; then
|
||||
if head=`git rev-parse --verify HEAD 2>/dev/null`; then
|
||||
if tag=`git describe --tags 2>/dev/null`; then
|
||||
v="$tag"
|
||||
fi
|
||||
|
||||
# Are there uncommitted changes?
|
||||
git update-index --refresh --unmerged > /dev/null
|
||||
if git diff-index --name-only HEAD | grep -v "^scripts/package" \
|
||||
| read dummy; then
|
||||
v="$v"-dirty
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
which hg &> /dev/null
|
||||
if [ $? == 0 -a -d .hg ]; then
|
||||
last=$(hg tags | grep -m1 -o '^v[0-9.]\+')
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user