You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficcontrol.apache.org by jv...@apache.org on 2016/11/28 16:45:27 UTC

[4/6] incubator-trafficcontrol git commit: revcount and commit from buildno

revcount and commit from buildno


Project: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/commit/c2564669
Tree: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/tree/c2564669
Diff: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/diff/c2564669

Branch: refs/heads/master
Commit: c2564669f3e206d88959fabb7338352b67e25aa7
Parents: df48015
Author: Dan Kirkwood <da...@gmail.com>
Authored: Sat Nov 12 19:00:25 2016 -0700
Committer: Jan van Doorn <jv...@apache.org>
Committed: Mon Nov 28 16:42:44 2016 +0000

----------------------------------------------------------------------
 build/functions.sh | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/c2564669/build/functions.sh
----------------------------------------------------------------------
diff --git a/build/functions.sh b/build/functions.sh
index 4f56e7a..6fa861f 100755
--- a/build/functions.sh
+++ b/build/functions.sh
@@ -44,7 +44,8 @@ function versionOk() {
 
 # ---------------------------------------
 function getRevCount() {
-	git rev-list HEAD 2>/dev/null | wc -l
+	local buildNum=$(getBuildNumber)
+	echo ${buildNum%.*}
 }
 
 # ---------------------------------------
@@ -57,7 +58,7 @@ function isInGitTree() {
 function getBuildNumber() {
 	local in_git=$()
 	if isInGitTree; then
-		local commits=$(getRevCount)
+		local commits=$(git rev-list HEAD 2>/dev/null | wc -l)
 		local sha=$(git rev-parse --short=8 HEAD)
 		echo "$commits.$sha"
 	else
@@ -85,7 +86,8 @@ function getRhelVersion {
 
 # ---------------------------------------
 function getCommit() {
-	git rev-parse HEAD
+	local buildNum=$(getBuildNumber)
+	echo ${buildNum%.*}
 }
 
 # ---------------------------------------