gustavonihei edited a comment on pull request #4144:
URL: https://github.com/apache/incubator-nuttx/pull/4144#issuecomment-879127078
The following patch fixes 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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]