1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-04-29 23:29:41 +02:00

Use git describe in About Dialog

- Replaced Commit Id by Version from GIT_DESCRIBE output
- Injected GIT_DESCRIBE macro at Version.cmake
- Removed timestamping from version description and cleaned its code

Resolve: #460

Signed-off-by: Humberto Rocha <humrochagf@gmail.com>
This commit is contained in:
Humberto Rocha 2021-08-12 10:56:15 -04:00 committed by Panagiotis Vasilopoulos
parent 20ee9a6c57
commit e0f34e7154
No known key found for this signature in database
GPG Key ID: FD806FDB3B2C5270
4 changed files with 9 additions and 22 deletions

View File

@ -4,7 +4,7 @@
execute_process(
COMMAND
${GIT} show -s "--format=#define REV_LONG \"%H\"%n#define REV_TIME \"%cd\"%n" --no-notes --no-show-signature
${GIT} show -s "--format=#define REV_LONG \"%H\"%n#define GIT_DESCRIBE \"${GIT_DESCRIBE}\"%n" --no-notes --no-show-signature
OUTPUT_FILE
${_PRVDIR}/RevisionIdent.h.in
OUTPUT_STRIP_TRAILING_WHITESPACE

View File

@ -176,7 +176,7 @@ void AboutDialog::CreateInformationTab(ShuttleGui& AboutDialogGUI) {
<< XO("The Build")
<< wxT("</h3>\n<table>"); // start build info table
AddBuildInfoRow(&informationStr, XO("Commit Id:"), BuildInfo::getRevisionIdentifier());
AddBuildInfoRow(&informationStr, XO("Version:"), BuildInfo::getRevisionIdentifier());
AddBuildInfoRow(&informationStr, XO("Build type:"), BuildInfo::getBuildType());
AddBuildInfoRow(&informationStr, XO("Compiler:"), BuildInfo::getCompilerVersionString());
@ -862,15 +862,15 @@ void AboutDialog::GenerateTenacityPageDescription(wxTextOutputStream& tos) {
#undef _
#define _(s) wxGetTranslation((s))
<< wxT("<h3>DarkTenacity ")
<< wxString(AUDACITY_VERSION_STRING)
<< wxString(GIT_DESCRIBE)
<< wxT("</h3>")
<< wxT("Customised version of the free, open source, cross-platform audio recorder and editor Tenacity.")
#else
<< XO("<h3>")
<< ProgramName
// << wxT(" ")
// << wxString(AUDACITY_VERSION_STRING)
<< wxT(" ")
<< wxString(GIT_DESCRIBE)
<< wxT("</h3>")
/* i18n-hint: The program's name substitutes for %s */
<< XO("Free, open source, cross-platform audio recorder and editor.")

View File

@ -17,7 +17,7 @@
#include <Internat.h>
// RevisionIdent contains the REV_TIME and REV_LONG defines from git commit information
// RevisionIdent contains the GIT_DESCRIBE and REV_LONG defines from git commit information
#include "RevisionIdent.h"
// This define replaces the original that modified the macro in wxwidgets
@ -88,29 +88,15 @@ public:
};
static const inline wxString getRevisionIdentifier(){
static wxString NoRevisionText = XO("No revision identifier was provided").Translation();
#ifdef REV_LONG
return wxString( "[[https://github.com/tenacityteam/tenacity/commit/" ) + REV_LONG + "|" + wxString( REV_LONG ).Left(6) + "]] of " + getRevisionDateTime();
return wxString("[[https://github.com/tenacityteam/tenacity/commit/") + REV_LONG + "|" + wxString(GIT_DESCRIBE) + "]]";
#else
return NoRevisionText;
#endif
}
static const inline wxString getRevisionDateTime(){
//This needs to be outside the #ifdef or it won't end up in the POT file consistently
static wxString NoDateTimeText = XO("Unknown date and time").Translation();
#ifdef REV_TIME
return wxString(REV_TIME);
#else
return NoDateTimeText;
#endif
}
static constexpr inline bool is64bits(){
return (sizeof(void*) == 8);
}

View File

@ -22,6 +22,7 @@ if( GIT_FOUND )
version
COMMAND
${CMAKE_COMMAND} -D GIT="${GIT_EXECUTABLE}"
-D GIT_DESCRIBE="${GIT_DESCRIBE}"
-D "_PRVDIR=${_PRVDIR}"
-P "${AUDACITY_MODULE_PATH}/Version.cmake"
WORKING_DIRECTORY