projects
/
openwrt
/
.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
scripts/getver.sh: improve revision output
[openwrt/.git]
/
scripts
/
getver.sh
diff --git
a/scripts/getver.sh
b/scripts/getver.sh
index a60b91ede1390a5fdceccbf9d649460ccea93801..4c8fab079c14aa3f1669865f892b51468e642f78 100755
(executable)
--- a/
scripts/getver.sh
+++ b/
scripts/getver.sh
@@
-23,9
+23,14
@@
try_git() {
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_REV="$(git rev-list reboot..$UPSTREAM_BASE --count)"
REV="$(git rev-list reboot..$GET_REV --count)"
REV="$(git rev-list reboot..$GET_REV --count)"
- REV="${REV:+r$REV}"
+ if [ -n "$REV" -a -n "$UPSTREAM_REV" -a "$REV" -gt "$UPSTREAM_REV" ]; then
+ REV="r${UPSTREAM_REV}+$((REV - UPSTREAM_REV))"
+ else
+ REV="${REV:+r$REV}"
+ fi
;;
esac
;;
esac