zabetak commented on code in PR #6411:
URL: https://github.com/apache/hive/pull/6411#discussion_r3098710467
##########
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:
Since we also print the revision/commit hash we should ensure that the
respective commit is present in the remote repo otherwise the built metadata
are not telling us much. To be honest, I am not sure if it's worth having
something very sophisticated in place.
Maven encourages the use of https://maven.apache.org/pom.html#SCM in the
pom.xml file and there essentially all URLs are hardcoded. There are also
various plugins (https://maven.apache.org/scm/index.html) that rely on this
information. The respective section is used in many Apache projects
(https://github.com/search?q=scm+user%3Aapache+path%3A**%2Fpom.xml&type=code&ref=advsearch).
All in all, hardcoding the upstream git URL is fine with me but not opposing
to other solutions. Ideally, we should rely on maven plugins to gather build
metadata but I guess this is a bit out of scope for now.
--
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]