maheshrajus commented on code in PR #6411:
URL: https://github.com/apache/hive/pull/6411#discussion_r3057719142


##########
common/src/scripts/saveVersion.sh:
##########
@@ -36,7 +36,10 @@ if [ "$revision" = "" ]; then
         revision=`git log -1 --pretty=format:"%H"`
         hostname=`hostname`
         branch=`git branch | sed -n -e 's/^* //p'`
-        url="git://${hostname}${cwd}"
+        url=$(git remote get-url origin 2>/dev/null)
+        if [ -z "$url" ]; then
+          url="Unknown"
+        fi

Review Comment:
   yeah, normally in CI env build systems when we checkout hive code freshly it 
will come under "origin" git remote repository. So i added check to cover the 
origin remote repo only. 
   
   We can add condition to check "upstream" remote repository also. 
   ```
   url=$(git remote get-url upstream 2>/dev/null)
   if [ -z "$url" ]; then
     url=$(git remote get-url origin 2>/dev/null)
   fi
   if [ -z "$url" ]; then
     url="Unknown"
   fi
   ```
   But here also again problem is there, we can configure "upstream" with some 
different repo also. In this case it will print the upstream pointing git url. 
   
   @ayushtkn Can we hard code this git 
URL(**https://github.com/apache/hive.git** ) in version info ?
   I am checking about hadoop behaviour how they are dealing such cases. thanks 
!
   



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to