[source] scripts/getver.sh: append short git hash based on upstream commit

LEDE Commits lede-commits at lists.infradead.org
Wed Mar 1 11:37:48 PST 2017


jow pushed a commit to source.git, branch lede-17.01:
https://git.lede-project.org/4bd0edc8fdbb8c02c71dacdfc2d6ebef3716eda5

commit 4bd0edc8fdbb8c02c71dacdfc2d6ebef3716eda5
Author: Magnus Kroken <mkroken at gmail.com>
AuthorDate: Sat Jan 14 22:34:01 2017 +0100

    scripts/getver.sh: append short git hash based on upstream commit
    
    The short git hash suffix printed by getver.sh is taken from the
    latest local commit, change this to use the hash from latest
    upstream commit if available. This is considered the intended
    behavior based on commit message a642a11faca87e2a7bddc1fadb54253e2fc26e84,
    introducing getver.sh.
    
    Signed-off-by: Magnus Kroken <mkroken at gmail.com>
    Signed-off-by: Felix Fietkau <nbd at nbd.name>
---
 scripts/getver.sh | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/scripts/getver.sh b/scripts/getver.sh
index ecf048f..9175f41 100755
--- a/scripts/getver.sh
+++ b/scripts/getver.sh
@@ -40,7 +40,8 @@ try_git() {
 			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
 



More information about the lede-commits mailing list