From 1ae592fcd94b86c4fee6b91786dfdc78724930fe Mon Sep 17 00:00:00 2001 From: Vaxry Date: Fri, 5 Apr 2024 00:44:21 +0100 Subject: hyprpm: add support for minimum versions --- src/debug/HyprCtl.cpp | 5 +++-- src/plugins/PluginAPI.cpp | 2 +- src/plugins/PluginAPI.hpp | 1 + src/version.h.in | 1 + 4 files changed, 6 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/debug/HyprCtl.cpp b/src/debug/HyprCtl.cpp index 3c53d97f..d672a2d0 100644 --- a/src/debug/HyprCtl.cpp +++ b/src/debug/HyprCtl.cpp @@ -810,7 +810,7 @@ std::string versionRequest(eHyprCtlOutputFormat format, std::string request) { if (format == eHyprCtlOutputFormat::FORMAT_NORMAL) { std::string result = "Hyprland, built from branch " + std::string(GIT_BRANCH) + " at commit " + GIT_COMMIT_HASH + " " + GIT_DIRTY + " (" + commitMsg + - ").\nDate: " + GIT_COMMIT_DATE + "\nTag: " + GIT_TAG + "\n\nflags: (if any)\n"; + ").\nDate: " + GIT_COMMIT_DATE + "\nTag: " + GIT_TAG + ", commits: " + GIT_COMMITS + "\n\nflags: (if any)\n"; #ifdef LEGACY_RENDERER result += "legacyrenderer\n"; @@ -832,8 +832,9 @@ std::string versionRequest(eHyprCtlOutputFormat format, std::string request) { "commit_message": "{}", "commit_date": "{}", "tag": "{}", + "commits": {}, "flags": [)#", - GIT_BRANCH, GIT_COMMIT_HASH, (strcmp(GIT_DIRTY, "dirty") == 0 ? "true" : "false"), escapeJSONStrings(commitMsg), GIT_COMMIT_DATE, GIT_TAG); + GIT_BRANCH, GIT_COMMIT_HASH, (strcmp(GIT_DIRTY, "dirty") == 0 ? "true" : "false"), escapeJSONStrings(commitMsg), GIT_COMMIT_DATE, GIT_TAG, GIT_COMMITS); #ifdef LEGACY_RENDERER result += "\"legacyrenderer\","; diff --git a/src/plugins/PluginAPI.cpp b/src/plugins/PluginAPI.cpp index 494aa640..78870666 100644 --- a/src/plugins/PluginAPI.cpp +++ b/src/plugins/PluginAPI.cpp @@ -364,7 +364,7 @@ APICALL SVersionInfo HyprlandAPI::getHyprlandVersion(HANDLE handle) { if (!PLUGIN) return {}; - return {GIT_COMMIT_HASH, GIT_TAG, GIT_DIRTY != std::string(""), GIT_BRANCH, GIT_COMMIT_MESSAGE}; + return {GIT_COMMIT_HASH, GIT_TAG, GIT_DIRTY != std::string(""), GIT_BRANCH, GIT_COMMIT_MESSAGE, GIT_COMMITS}; } APICALL std::shared_ptr HyprlandAPI::registerHyprCtlCommand(HANDLE handle, SHyprCtlCommand cmd) { diff --git a/src/plugins/PluginAPI.hpp b/src/plugins/PluginAPI.hpp index a7a998b4..575fef40 100644 --- a/src/plugins/PluginAPI.hpp +++ b/src/plugins/PluginAPI.hpp @@ -49,6 +49,7 @@ struct SVersionInfo { bool dirty = false; std::string branch; std::string message; + std::string commits; }; #define APICALL extern "C" diff --git a/src/version.h.in b/src/version.h.in index e0dd8a83..a77b2468 100644 --- a/src/version.h.in +++ b/src/version.h.in @@ -5,3 +5,4 @@ #define GIT_COMMIT_DATE "@DATE@" #define GIT_DIRTY "@DIRTY@" #define GIT_TAG "@TAG@" +#define GIT_COMMITS "@COMMITS@" -- cgit v1.2.3