Use github api to find the total number of commits

That approach is faster and doesn't require huge download to determine
the total number of commits.

Signed-off-by: Przemo Firszt <przemo@firszt.eu>
This commit is contained in:
Przemo Firszt
2018-11-10 11:51:35 +00:00
committed by wmayer
parent 9e2acc477c
commit 7ed7b7add0
2 changed files with 2 additions and 4 deletions

View File

@@ -1,2 +0,0 @@
[rpkg]
auto_pack = False

View File

@@ -1,4 +1,4 @@
function git_commits_no {
commits=$(git fetch --unshallow && git rev-list master --count)
echo $commits
commits=$(curl -s 'https://api.github.com/repos/FreeCAD/FreeCAD/compare/120ca87015...master' | grep "ahead_by" | sed -s 's/ //g' | sed -s 's/"ahead_by"://' | sed -s 's/,//')
echo $((commits + 1))
}