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@crc.id.au> Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>
This commit is contained in:
parent
eae812ddb6
commit
f1765277ba
1 changed files with 3 additions and 3 deletions
|
@ -19,13 +19,13 @@ try_git() {
|
||||||
case "$GET_REV" in
|
case "$GET_REV" in
|
||||||
r*)
|
r*)
|
||||||
GET_REV="$(echo $GET_REV | tr -d '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)))"
|
REV="$(git rev-parse HEAD~$((BASE_REV - GET_REV)))"
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
UPSTREAM_BASE="$(git merge-base $GET_REV origin/master)"
|
UPSTREAM_BASE="$(git merge-base $GET_REV origin/master)"
|
||||||
UPSTREAM_REV="$(git rev-list reboot..$UPSTREAM_BASE --count)"
|
UPSTREAM_REV="$(git rev-list reboot..$UPSTREAM_BASE | wc -l)"
|
||||||
REV="$(git rev-list reboot..$GET_REV --count)"
|
REV="$(git rev-list reboot..$GET_REV | wc -l)"
|
||||||
if [ -n "$REV" -a -n "$UPSTREAM_REV" -a "$REV" -gt "$UPSTREAM_REV" ]; then
|
if [ -n "$REV" -a -n "$UPSTREAM_REV" -a "$REV" -gt "$UPSTREAM_REV" ]; then
|
||||||
REV="r${UPSTREAM_REV}+$((REV - UPSTREAM_REV))"
|
REV="r${UPSTREAM_REV}+$((REV - UPSTREAM_REV))"
|
||||||
else
|
else
|
||||||
|
|
Loading…
Reference in a new issue