The code below is used to parse the actual version number out of the version string. The version string currently something like this for a tagged version
commit date 2023-06-28 11:09:36 -0500 (grafted, HEAD, tag: v0.99.4) v0.99.4
and this for an untagged version
commit date 2023-08-18 10:39:17 -0400 (HEAD, origin/dev_zynqmon_path, dev_zynqmon_path) v0.99.4-40-g5f95c6a-dirty
This works for untagged versions but it doesn't work for tagged versions because the version string is repeated 2x.
The string is generated by the makefile in projects/cm_mcu with a command like this:
GIT_VERSION="$(shell git --no-pager show -s --format="commit date %ci %d" ; git describe --dirty --always --tags )"
so for the version that gets sent to the zynq the code above gets the wrong answer, as evidenced by this BUTool command:
The correct outcome would be to just report v0.99.4, not 2x with the extra bonus parenthesis. The possible ways to do this might be either to
fix the code snippet above to only find the string once, possibly by starting the search from the end of the string, rather than the start, but not changing the strings stored in the makefile
change the makefile to separate out the branches and the tag into two variables when the code is built
The code below is used to parse the actual version number out of the version string. The version string currently something like this for a tagged version
and this for an untagged version
The following code is used to pull out the semver version (i.e., the part that is vXX.YY.ZZ-*-dirty) https://github.com/apollo-lhc/cm_mcu/blob/bc04d3fa801c489bd475a1c3c9e535fbcbeed760/projects/cm_mcu/ZynqMonTask.c#L229-L233
This works for untagged versions but it doesn't work for tagged versions because the version string is repeated 2x. The string is generated by the makefile in
projects/cm_mcu
with a command like this:so for the version that gets sent to the zynq the code above gets the wrong answer, as evidenced by this BUTool command:
The correct outcome would be to just report
v0.99.4
, not 2x with the extra bonus parenthesis. The possible ways to do this might be either to