diff --git a/README.md b/README.md index 8cd26c4a..34f8d818 100644 --- a/README.md +++ b/README.md @@ -53,6 +53,17 @@ desired behavior. Please check out the [Getting Started](GETTING_STARTED.md) guide. # Release notes +## Release notes for 3.8.9 + +### New Features + +Bugs addressed in this release: + +* [#692](../../issues/692) CalChart Windows Field Thumbnails Appear Incorrectly +* [#694](../../issues/694) Calchart ignoring reference points/transitions + +Other changes: + ## Release notes for 3.8.8 ### New Features diff --git a/RELEASE_INSTRUCTIONS.md b/RELEASE_INSTRUCTIONS.md index e5aa9809..0d6d5516 100644 --- a/RELEASE_INSTRUCTIONS.md +++ b/RELEASE_INSTRUCTIONS.md @@ -13,7 +13,7 @@ Checklist CalChart uses CMake and Github actions to automate the release process. When you push a tag for the repository, github will build and package the release. -The current calchart version is 3.8.8. In all commands below, substitute that number for `$CCVER` (meaning when you read `$CCVER`, type 3.8.8). When incrementing, be sure to consider if it's time to bump the MINOR version. Only do that if there's incompatibilities, such as a new feature that won't work on a previous version of CalChart. +The current calchart version is 3.8.9. In all commands below, substitute that number for `$CCVER` (meaning when you read `$CCVER`, type 3.8.9). When incrementing, be sure to consider if it's time to bump the MINOR version. Only do that if there's incompatibilities, such as a new feature that won't work on a previous version of CalChart. 1. Create a git branch to prep the changes: `git checkout -b dev/prep_$CCVER` @@ -32,8 +32,8 @@ awk '//; /^# Release notes/{while(getline<"LATEST_RELEASE_NOTES.md"){print}}' RE 6. Tag the depot ``` -$ git tag -a v3.8.8 -m "calchart-3.8.8" -$ git push origin v3.8.8 +$ git tag -a v3.8.9 -m "calchart-3.8.9" +$ git push origin v3.8.9 ``` This should trigger the github action, which should publish release notes in Draft form. diff --git a/ccvers.h.in b/ccvers.h.in index e6e2fd21..49c11b0f 100644 --- a/ccvers.h.in +++ b/ccvers.h.in @@ -18,9 +18,11 @@ #include +// clang-format off #define CC_MAJOR_VERSION @CalChart_VERSION_MAJOR@ #define CC_MINOR_VERSION @CalChart_VERSION_MINOR@ #define CC_PATCH_VERSION @CalChart_VERSION_PATCH@ +// clang-format on #define STRINGIZE_HELPER(name) #name #define STRINGIZE(x) STRINGIZE_HELPER(x) @@ -30,6 +32,9 @@ #define CC_VERSION \ MK_CC_VERSION(CC_MAJOR_VERSION, CC_MINOR_VERSION, CC_PATCH_VERSION) +// Full git version including commit hash (e.g., "v3.6.2-48-g6538532") +#define CC_GIT_VERSION "@CalChart_GIT_VERSION@" + static constexpr uint32_t kVersion = (CC_MAJOR_VERSION << 8) | CC_MINOR_VERSION; namespace { diff --git a/cmake/version.cmake b/cmake/version.cmake index fb01d7b7..5688fcf5 100644 --- a/cmake/version.cmake +++ b/cmake/version.cmake @@ -3,22 +3,43 @@ # This will produce a string of the form v3.6.2-48-g6538532 # which is the tag plus number of changes since the tag if any -execute_process(COMMAND git describe --tags +execute_process(COMMAND git describe --tags --always --dirty OUTPUT_VARIABLE GIT_VERS + OUTPUT_STRIP_TRAILING_WHITESPACE ) +# Save the full git version for diagnostic purposes +set (CalChart_GIT_VERSION "${GIT_VERS}") + # decompose the tag string into: 'v' Major '.' Minor '.' Patch -string(STRIP ${GIT_VERS} GIT_VERS) -string(SUBSTRING ${GIT_VERS} 1 -1 GIT_VERS) -string(FIND ${GIT_VERS} "." bound) -string(SUBSTRING ${GIT_VERS} 0 ${bound} Found_MAJOR) -string(SUBSTRING ${GIT_VERS} ${bound} -1 GIT_VERS) -string(SUBSTRING ${GIT_VERS} 1 -1 GIT_VERS) -string(FIND ${GIT_VERS} "." bound) -string(SUBSTRING ${GIT_VERS} 0 ${bound} Found_MINOR) -string(SUBSTRING ${GIT_VERS} ${bound} -1 GIT_VERS) -string(SUBSTRING ${GIT_VERS} 1 -1 GIT_VERS) -set (Found_PATCH ${GIT_VERS}) +# Strip the leading 'v' if present +set (GIT_VERS_STRIPPED "${GIT_VERS}") +if (GIT_VERS_STRIPPED MATCHES "^v") + string(SUBSTRING ${GIT_VERS_STRIPPED} 1 -1 GIT_VERS_STRIPPED) +endif() + +# Extract major version +string(FIND ${GIT_VERS_STRIPPED} "." bound) +if (bound GREATER -1) + string(SUBSTRING ${GIT_VERS_STRIPPED} 0 ${bound} Found_MAJOR) + string(SUBSTRING ${GIT_VERS_STRIPPED} ${bound} -1 GIT_VERS_STRIPPED) + string(SUBSTRING ${GIT_VERS_STRIPPED} 1 -1 GIT_VERS_STRIPPED) +else() + set(Found_MAJOR 0) +endif() + +# Extract minor version +string(FIND ${GIT_VERS_STRIPPED} "." bound) +if (bound GREATER -1) + string(SUBSTRING ${GIT_VERS_STRIPPED} 0 ${bound} Found_MINOR) + string(SUBSTRING ${GIT_VERS_STRIPPED} ${bound} -1 GIT_VERS_STRIPPED) + string(SUBSTRING ${GIT_VERS_STRIPPED} 1 -1 GIT_VERS_STRIPPED) +else() + set(Found_MINOR 0) +endif() + +# Rest is patch (may include -commits-ghash) +set (Found_PATCH ${GIT_VERS_STRIPPED}) set (CalChart_VERSION_MAJOR ${Found_MAJOR}) set (CalChart_VERSION_MINOR ${Found_MINOR}) diff --git a/core/CalChartDiagnosticInfo.cpp b/core/CalChartDiagnosticInfo.cpp index d15fd610..be3c7211 100644 --- a/core/CalChartDiagnosticInfo.cpp +++ b/core/CalChartDiagnosticInfo.cpp @@ -105,8 +105,8 @@ auto DiagnosticInfo::Create() -> DiagnosticInfo { auto info = DiagnosticInfo{}; - // CalChart version from ccvers.h - info.calchart_version = CC_VERSION; + // CalChart version from ccvers.h (includes git hash) + info.calchart_version = CC_GIT_VERSION; // Build type #ifdef NDEBUG diff --git a/src/CalChartFrame.cpp b/src/CalChartFrame.cpp index 1669baa6..4fbbfaf8 100644 --- a/src/CalChartFrame.cpp +++ b/src/CalChartFrame.cpp @@ -185,7 +185,7 @@ CalChartFrame::CalChartFrame(wxDocument* doc, wxView* view, CalChart::Configurat // Give it a status line CreateStatusBar(3); - SetStatusText("Welcome to Calchart " CC_VERSION); + SetStatusText("Welcome to Calchart " CC_GIT_VERSION); wxUI::MenuProxy editMenu; wxUI::MenuBar{ diff --git a/src/CalChartSplash.cpp b/src/CalChartSplash.cpp index dff0d003..82b9398e 100644 --- a/src/CalChartSplash.cpp +++ b/src/CalChartSplash.cpp @@ -154,7 +154,7 @@ CalChartSplash::CalChartSplash(wxDocManager* manager, wxFrame* frame, std::strin wxUI::VSizer{ BasicSizerFlags(), wxUI::Bitmap{ BitmapWithBandIcon(GetLogoSize()) }.withFlags(ExpandSizerFlags()), - wxUI::Text{ "CalChart " CC_VERSION } + wxUI::Text{ "CalChart " CC_GIT_VERSION } .withFont(fontTitle), wxUI::Text{ std::string{ "Built with: " } + wxString{ wxVERSION_STRING }.ToStdString() } .withFont(fontSubTitle), @@ -188,7 +188,7 @@ void CalChartSplash::About() { // clang-format off (void)wxMessageBox( - "CalChart " CC_VERSION "\n" + "CalChart " CC_GIT_VERSION "\n" "Built with: " wxVERSION_STRING "\n" "Authors: Gurk Meeker, Richard Michael Powell\n" "\n" diff --git a/tools/calchart_cmd/main.cpp b/tools/calchart_cmd/main.cpp index 434a5655..11341d33 100644 --- a/tools/calchart_cmd/main.cpp +++ b/tools/calchart_cmd/main.cpp @@ -41,7 +41,7 @@ constexpr auto USAGE = --version Show version. )"; -constexpr auto version = "calchart_cmd " CC_VERSION; +constexpr auto version = "calchart_cmd " CC_GIT_VERSION; void PrintToPS(std::string_view showPath, bool landscape, bool cont, bool contsheet, bool overview, std::string_view outfile) {