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:
@@ -1,2 +0,0 @@
|
||||
[rpkg]
|
||||
auto_pack = False
|
||||
@@ -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))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user