scripts/getver.sh: append short git hash based on upstream commit
[openwrt/openwrt.git] / scripts / getver.sh
index ecf048f4c1c88b308295e5d9d79e34bc2f70a12e..9175f411db8345ab420fdb1edcaf0d20f858f12f 100755 (executable)
@@ -40,7 +40,8 @@ try_git() {
                        REV="${UPSTREAM_REV}+$((REV - UPSTREAM_REV))"
                fi
 
                        REV="${UPSTREAM_REV}+$((REV - UPSTREAM_REV))"
                fi
 
-               REV="${REV:+r$REV-$(git log --format="%h" -1)}"
+               REV="${REV:+r$REV-$(git log -n 1 --format="%h" $UPSTREAM_BASE)}"
+
                ;;
        esac
 
                ;;
        esac