You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by GitBox <gi...@apache.org> on 2021/07/13 14:15:37 UTC
[GitHub] [incubator-nuttx] gustavonihei commented on pull request #4144: tools/version.sh: Fix version number to get on master branch
gustavonihei commented on pull request #4144:
URL: https://github.com/apache/incubator-nuttx/pull/4144#issuecomment-879127078
The following patch fix the way git sorts the tag name:
```patch
diff --git a/tools/version.sh b/tools/version.sh
index f0e5efbaaa..beac1d1ab2 100755
--- a/tools/version.sh
+++ b/tools/version.sh
@@ -76,7 +76,7 @@ if [ -z ${VERSION} ] ; then
# If the VERSION does not match X.Y.Z, retrieve version from the tag
if [[ ! ${VERSION} =~ ([0-9]+)\.([0-9]+)\.([0-9]+) ]] ; then
- VERSION=`git -C ${WD} tag --sort=v:refname | grep -E "nuttx-[0-9]+\.[0-9]+\.[0-9]+" | tail -1 | cut -d'-' -f2-`
+ VERSION=`git -C ${WD} -c 'versionsort.suffix=-' tag --sort=v:refname | grep -E "nuttx-[0-9]+\.[0-9]+\.[0-9]+" | tail -1 | cut -d'-' -f2-`
fi
fi
```
Reference: https://stackoverflow.com/a/52680984
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org