Skip to content

Commit 6a6459b

Browse files
committed
git-gui: Handle gitgui tags in version gen.
I've decided to use gitgui-0.5 as the format for tags in the git-gui repository. The prefix of gitgui was chosen here to make its namespace different from the namespace used by git itself, allowing developers to pull both tag namespaces into the same repository. Signed-off-by: Shawn O. Pearce <[email protected]>
1 parent 5d643cd commit 6a6459b

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

GIT-VERSION-GEN

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/bin/sh
22

33
GVF=GIT-VERSION-FILE
4-
DEF_VER=v0.5.GIT
4+
DEF_VER=0.5.GIT
55

66
LF='
77
'
@@ -11,19 +11,17 @@ LF='
1111
if VN=$(git describe --abbrev=4 HEAD 2>/dev/null) &&
1212
case "$VN" in
1313
*$LF*) (exit 1) ;;
14-
v[0-9]*) : happy ;;
14+
gitgui-[0-9]*) : happy ;;
1515
esac
1616
then
17-
VN=$(echo "$VN" | sed -e 's/-/./g');
17+
VN=$(echo "$VN" | sed -e 's/^gitgui-//;s/-/./g');
1818
elif test -f version
1919
then
2020
VN=$(cat version) || VN="$DEF_VER"
2121
else
2222
VN="$DEF_VER"
2323
fi
2424

25-
VN=$(expr "$VN" : v*'\(.*\)')
26-
2725
dirty=$(sh -c 'git diff-index --name-only HEAD' 2>/dev/null) || dirty=
2826
case "$dirty" in
2927
'')

0 commit comments

Comments
 (0)