aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorvaxerski <[email protected]>2022-04-22 18:29:32 +0200
committervaxerski <[email protected]>2022-04-22 18:29:32 +0200
commitd7b3145b2e9af0ea2779a52e0c3b10b6f4a84334 (patch)
tree2eed0008315cc2b61b383b2190031a475c3a93db
parente3b19e01319bdda7f3f5799f53e28dade0bd1265 (diff)
downloadHyprland-d7b3145b2e9af0ea2779a52e0c3b10b6f4a84334.tar.gz
Hyprland-d7b3145b2e9af0ea2779a52e0c3b10b6f4a84334.zip
Added git commit message to hyprctl version
-rw-r--r--CMakeLists.txt7
-rw-r--r--src/debug/HyprCtl.cpp2
-rw-r--r--src/defines.hpp3
3 files changed, 11 insertions, 1 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 34cd48c4..4cd662f1 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -20,6 +20,12 @@ execute_process(
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
OUTPUT_VARIABLE GIT_COMMIT_HASH
OUTPUT_STRIP_TRAILING_WHITESPACE)
+
+execute_process(
+ COMMAND bash -c "git show ${GIT_COMMIT_HASH} | head -n 5 | tail -n 1"
+ WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
+ OUTPUT_VARIABLE GIT_COMMIT_MESSAGE
+ OUTPUT_STRIP_TRAILING_WHITESPACE)
#
#
@@ -54,6 +60,7 @@ ENDIF(CMAKE_BUILD_TYPE MATCHES Debug OR CMAKE_BUILD_TYPE MATCHES DEBUG)
target_compile_definitions(Hyprland PRIVATE "-DGIT_COMMIT_HASH=\"${GIT_COMMIT_HASH}\"")
target_compile_definitions(Hyprland PRIVATE "-DGIT_BRANCH=\"${GIT_BRANCH}\"")
+target_compile_definitions(Hyprland PRIVATE "-DGIT_COMMIT_MESSAGE=\"${GIT_COMMIT_MESSAGE}\"")
target_link_libraries(Hyprland rt)
diff --git a/src/debug/HyprCtl.cpp b/src/debug/HyprCtl.cpp
index cb48b4d7..6986b601 100644
--- a/src/debug/HyprCtl.cpp
+++ b/src/debug/HyprCtl.cpp
@@ -72,7 +72,7 @@ std::string layersRequest() {
}
std::string versionRequest() {
- std::string result = "Hyprland, built from branch " + std::string(GIT_BRANCH) + " at commit " + GIT_COMMIT_HASH + ", flags: (if any)\n";
+ std::string result = "Hyprland, built from branch " + std::string(GIT_BRANCH) + " at commit " + GIT_COMMIT_HASH + " (" + GIT_COMMIT_MESSAGE + ").\nflags: (if any)\n";
#ifdef LEGACY_RENDERER
result += "legacyrenderer\n";
diff --git a/src/defines.hpp b/src/defines.hpp
index a54d7336..13701a03 100644
--- a/src/defines.hpp
+++ b/src/defines.hpp
@@ -57,4 +57,7 @@
#endif
#ifndef GIT_BRANCH
#define GIT_BRANCH "?"
+#endif
+#ifndef GIT_COMMIT_MESSAGE
+#define GIT_COMMIT_MESSAGE "?"
#endif \ No newline at end of file