Skip to content

Commit 3e470b3

Browse files
committed
HIVE-29104: fix git URL in --version output
1 parent 843168b commit 3e470b3

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

common/src/scripts/saveVersion.sh

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,10 @@ if [ "$revision" = "" ]; then
3636
revision=`git log -1 --pretty=format:"%H"`
3737
hostname=`hostname`
3838
branch=`git branch | sed -n -e 's/^* //p'`
39-
url="git://${hostname}${cwd}"
39+
url=$(git remote -v | grep -E 'apache.org|github.com[/:]apache/hive' | head -n 1 | awk '{print $2}')
40+
if [ -z "$url" ]; then
41+
url="Unknown"
42+
fi
4043
elif [ -d .svn ]; then
4144
revision=`svn info ../ | sed -n -e 's/Last Changed Rev: \(.*\)/\1/p'`
4245
url=`svn info ../ | sed -n -e 's/^URL: \(.*\)/\1/p'`

0 commit comments

Comments
 (0)