[source] scripts: getver.sh: append Git short hash to revision

LEDE Commits lede-commits at lists.infradead.org
Fri Dec 2 07:39:04 PST 2016


jow pushed a commit to source.git, branch master:
https://git.lede-project.org/a642a11faca87e2a7bddc1fadb54253e2fc26e84

commit a642a11faca87e2a7bddc1fadb54253e2fc26e84
Author: Jo-Philipp Wich <jo at mein.io>
AuthorDate: Fri Dec 2 12:07:19 2016 +0100

    scripts: getver.sh: append Git short hash to revision
    
    Change getver.sh to append a short Git commit hash to the end of the artifical
    revision number. This way we still have order- and comparable commit numbers
    but also a direct relation to the Git commit.
    
    The new output format will look like "r2400+2-882472e" for dirty trees or like
    "r2402-882472e" for clean ones.
    
    Signed-off-by: Jo-Philipp Wich <jo at mein.io>
---
 scripts/getver.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/scripts/getver.sh b/scripts/getver.sh
index d5f2986..ecf048f 100755
--- a/scripts/getver.sh
+++ b/scripts/getver.sh
@@ -40,7 +40,7 @@ try_git() {
 			REV="${UPSTREAM_REV}+$((REV - UPSTREAM_REV))"
 		fi
 
-		REV="${REV:+r$REV}"
+		REV="${REV:+r$REV-$(git log --format="%h" -1)}"
 		;;
 	esac
 



More information about the lede-commits mailing list