# HG changeset patch # User Mike Becker # Date 1754832145 -7200 # Node ID d77763d2fdda7b62ba580fc5c47ce48590f225f4 # Parent 9b1cbc665851d2feb143bcbc0bf14397b087ec1e highlight days with tags - resolves #672 diff -r 9b1cbc665851 -r d77763d2fdda src/commit-data.h --- a/src/commit-data.h Sun Aug 10 11:59:03 2025 +0200 +++ b/src/commit-data.h Sun Aug 10 15:22:25 2025 +0200 @@ -25,16 +25,19 @@ #ifndef COMMIT_DATA_H #define COMMIT_DATA_H -#include +#include #include #include #include namespace fm { struct commits final { - std::map< + std::unordered_map< std::string, // repository name std::vector > summaries; + std::unordered_map< + std::string, // repository name + std::vector > tags; [[nodiscard]] unsigned count(const std::string &repo) const { return summaries.at(repo).size(); diff -r 9b1cbc665851 -r d77763d2fdda src/heatmap.cpp --- a/src/heatmap.cpp Sun Aug 10 11:59:03 2025 +0200 +++ b/src/heatmap.cpp Sun Aug 10 15:22:25 2025 +0200 @@ -41,10 +41,12 @@ const auto line_view = std::string_view{line}; const auto pos_delim1 = line_view.find('#', 0); const auto pos_delim2 = line_view.find('#', pos_delim1 + 1); + const auto pos_delim3 = line_view.find('#', pos_delim2 + 1); std::string author{settings.map_author(line_view.substr(0, pos_delim1))}; - std::string_view date_view{line_view.substr(pos_delim1+1, pos_delim2)}; - std::string_view summary_view{line_view.substr(pos_delim2+1)}; + std::string_view date_view{line_view.substr(pos_delim1+1, pos_delim2 - pos_delim1 - 1)}; + std::string_view tags_view{line_view.substr(pos_delim2+1, pos_delim3 - pos_delim2 - 1)}; + std::string_view summary_view{line_view.substr(pos_delim3+1)}; int year = 0; unsigned int month = 0, day = 0; @@ -54,10 +56,14 @@ std::from_chars(date_parts[0].begin(), date_parts[0].end(), year); std::from_chars(date_parts[1].begin(), date_parts[1].end(), month); std::from_chars(date_parts[2].begin(), date_parts[2].end(), day); - auto &[summaries] = m_heatmap[repo_key][author][chrono::year_month_day{ - chrono::year{year}, chrono::month{month}, chrono::day{day} - }]; + auto &[summaries, tags] = + m_heatmap[repo_key][author][chrono::year_month_day{ + chrono::year{year}, chrono::month{month}, chrono::day{day} + }]; summaries[m_current_repo].emplace_back(summary_view); + if (!tags_view.empty()) { + tags[m_current_repo].emplace_back(tags_view); + } } } diff -r 9b1cbc665851 -r d77763d2fdda src/html.cpp --- a/src/html.cpp Sun Aug 10 11:59:03 2025 +0200 +++ b/src/html.cpp Sun Aug 10 15:22:25 2025 +0200 @@ -86,20 +86,21 @@