From 563a1a0da15a467b5a1ad62545548534fd23c585 Mon Sep 17 00:00:00 2001 From: Augustin Cavalier Date: Sat, 15 Sep 2018 20:00:02 -0400 Subject: [PATCH] determine_haiku_revision: Rework "no tag on HEAD" output. When HEAD is tagged, the output will be identical to what it was before (the latest hrev tag and nothing else.) When HEAD is not tagged, and the most recent tag is further back, we now use a format like this: hrevXXXXX+N(+dirty) ... where N is the number of commits since hrevXXXXX, and +dirty is added if the working tree is dirty. This is significantly shorter than the previous model (as it does not have the Git revision.) Fixes #14445. Change-Id: Ide7f66cf0ac1c1f05402afc52b6be3b68b66d6dc Reviewed-on: https://review.haiku-os.org/566 Reviewed-by: waddlesplash --- build/scripts/determine_haiku_revision | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/build/scripts/determine_haiku_revision b/build/scripts/determine_haiku_revision index 0796c8c2e0..3d175fc43c 100755 --- a/build/scripts/determine_haiku_revision +++ b/build/scripts/determine_haiku_revision @@ -24,18 +24,21 @@ export LC_ALL=C localRev=`git rev-parse HEAD` -# only determine the haiku-revision if anything has changed from +# only determine the haiku-revision if anything has changed from the # last build if [ -z "$revision" -o "$lastBuiltRevision" != "$localRev" ]; then # the revision we use is the description of HEAD with respect to the # last reachable hrev-(haiku-revision-)tag - revision=`git describe --dirty --tags --match=hrev*` + revision=`git describe --dirty --tags --match=hrev* --abbrev=1` if [ -z "$revision" ]; then # failed to find any hrev tags, bail out echo "Error: you are using a Haiku clone without tags, please set" echo " the revision tag to use (e.g. HAIKU_REVISION=hrev43210)" exit 1 - elif echo "$revision" | grep -- '-' >/dev/null; then + fi + + revision=`echo $revision | sed 's/-g.....//' | sed 's/-/+/g'` + if echo "$revision" | grep -- '-' >/dev/null; then # HEAD is not directly a changeset from Haiku's central repo, so we # add the current branch name as additional info branchName=`git branch | grep '*' | cut -b 3-`