[source] scripts/getver.sh: avoid use of git rev-list --count

LEDE Commits lede-commits at lists.infradead.org
Sat Jul 9 06:09:04 PDT 2016


jogo pushed a commit to source.git, branch master:
https://git.lede-project.org/?p=source.git;a=commitdiff;h=f1765277bacbea47a45ed913ca8fa043e9f71393

commit f1765277bacbea47a45ed913ca8fa043e9f71393
Author: Jonas Gorski <jonas.gorski at gmail.com>
AuthorDate: Sat Jul 9 15:01:58 2016 +0200

    scripts/getver.sh: avoid use of git rev-list --count
    
    This is not a valid option in older git version, used in e.g. RHEL6.
    
    Reported-by: Steven Haigh <netwiz at crc.id.au>
    Signed-off-by: Jonas Gorski <jonas.gorski at gmail.com>
---
 scripts/getver.sh | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/scripts/getver.sh b/scripts/getver.sh
index 4c8fab0..fa2e676 100755
--- a/scripts/getver.sh
+++ b/scripts/getver.sh
@@ -19,13 +19,13 @@ try_git() {
 	case "$GET_REV" in
 	r*)
 		GET_REV="$(echo $GET_REV | tr -d 'r')"
-		BASE_REV="$(git rev-list reboot..HEAD --count)"
+		BASE_REV="$(git rev-list reboot..HEAD | wc -l)"
 		REV="$(git rev-parse HEAD~$((BASE_REV - GET_REV)))"
 		;;
 	*)
 		UPSTREAM_BASE="$(git merge-base $GET_REV origin/master)"
-		UPSTREAM_REV="$(git rev-list reboot..$UPSTREAM_BASE --count)"
-		REV="$(git rev-list reboot..$GET_REV --count)"
+		UPSTREAM_REV="$(git rev-list reboot..$UPSTREAM_BASE | wc -l)"
+		REV="$(git rev-list reboot..$GET_REV | wc -l)"
 		if [ -n "$REV" -a -n "$UPSTREAM_REV" -a "$REV" -gt "$UPSTREAM_REV" ]; then
 			REV="r${UPSTREAM_REV}+$((REV - UPSTREAM_REV))"
 		else



More information about the lede-commits mailing list