diff --git a/cmake/Comptime.cmake b/cmake/Comptime.cmake index f50faf933..8388aed9e 100644 --- a/cmake/Comptime.cmake +++ b/cmake/Comptime.cmake @@ -11,8 +11,9 @@ include(GitUtilities) git_current_branch(SRB2_COMP_BRANCH) git_working_tree_dirty(SRB2_COMP_UNCOMMITTED) -git_summary(revision) -string(REGEX REPLACE "([\"\\])" "\\\\\\1" SRB2_COMP_REVISION "${revision}") +git_latest_commit(SRB2_COMP_REVISION) +git_subject(subject) +string(REGEX REPLACE "([\"\\])" "\\\\\\1" SRB2_COMP_NOTE "${subject}") if("${CMAKE_BUILD_TYPE}" STREQUAL "") set(CMAKE_BUILD_TYPE None) diff --git a/cmake/Modules/GitUtilities.cmake b/cmake/Modules/GitUtilities.cmake index bddc552a6..586c7b433 100644 --- a/cmake/Modules/GitUtilities.cmake +++ b/cmake/Modules/GitUtilities.cmake @@ -50,8 +50,8 @@ function(git_working_tree_dirty variable) endif() endfunction() -function(git_summary variable) - _git_easy_command(log -1 "--format=%h %s") +function(git_subject variable) + _git_easy_command(log -1 --format=%s) endfunction() function(get_git_dir variable) diff --git a/src/comptime.c b/src/comptime.c index 74b810062..386b53f46 100644 --- a/src/comptime.c +++ b/src/comptime.c @@ -11,6 +11,7 @@ #include "config.h" const char *compbranch = SRB2_COMP_BRANCH; const char *comprevision = SRB2_COMP_REVISION; +const char *compnote = SRB2_COMP_NOTE; const char *comptype = CMAKE_BUILD_TYPE; const int compoptimized = SRB2_COMP_OPTIMIZED; diff --git a/src/config.h.in b/src/config.h.in index 77a205a74..bf79b61ad 100644 --- a/src/config.h.in +++ b/src/config.h.in @@ -13,6 +13,7 @@ #define SRB2_COMP_REVISION "${SRB2_COMP_REVISION}" #define SRB2_COMP_BRANCH "${SRB2_COMP_BRANCH}" +#define SRB2_COMP_NOTE "${SRB2_COMP_NOTE}" // This is done with configure_file instead of defines in order to avoid // recompiling the whole target whenever the working directory state changes #cmakedefine SRB2_COMP_UNCOMMITTED diff --git a/src/d_netcmd.c b/src/d_netcmd.c index 97b71478e..7529a5e94 100644 --- a/src/d_netcmd.c +++ b/src/d_netcmd.c @@ -4772,7 +4772,7 @@ static void Command_ListDoomednums_f(void) static void Command_Version_f(void) { #ifdef DEVELOP - CONS_Printf("Ring Racers %s %s (%s %s)\n", compbranch, comprevision, compdate, comptime); + CONS_Printf("Ring Racers %s %s %s (%s %s)\n", compbranch, comprevision, compnote, compdate, comptime); #else CONS_Printf("Ring Racers %s (%s %s %s %s) ", VERSIONSTRING, compdate, comptime, comprevision, compbranch); #endif diff --git a/src/doomdef.h b/src/doomdef.h index 3a1e11b44..ffffd59d5 100644 --- a/src/doomdef.h +++ b/src/doomdef.h @@ -668,6 +668,7 @@ extern const char *comptime, *comprevision, *compbranch, + *compnote, *comptype; extern int compuncommitted, diff --git a/src/f_finale.c b/src/f_finale.c index 36ca452f9..54a7bbb3b 100644 --- a/src/f_finale.c +++ b/src/f_finale.c @@ -1913,7 +1913,7 @@ void F_VersionDrawer(void) addtext(V_ALLOWLOWERCASE|V_REDMAP, "Netgame host for testers"); addtext(V_ALLOWLOWERCASE|V_TRANSLUCENT, va("%s", compdate)); #elif defined(DEVELOP) - addtext(V_ALLOWLOWERCASE|V_TRANSLUCENT, comprevision); + addtext(V_ALLOWLOWERCASE|V_TRANSLUCENT, va("%s %s", comprevision, compnote)); addtext(V_ALLOWLOWERCASE|V_TRANSLUCENT, compbranch); #else // Regular build addtext(V_ALLOWLOWERCASE|V_TRANSLUCENT, va("%s", VERSIONSTRING));