diff --git a/Utilities/git-version-gen.cmd b/Utilities/git-version-gen.cmd index 4ec3e10d20..0346559c55 100644 --- a/Utilities/git-version-gen.cmd +++ b/Utilities/git-version-gen.cmd @@ -53,7 +53,8 @@ if errorlevel 1 ( goto done ) -for /F %%I IN ('call %GIT% describe --always') do set GIT_VERSION=%%I +for /F %%I IN ('call %GIT% rev-list HEAD --count') do set GIT_VERSION=%%I +for /F %%I IN ('call %GIT% rev-parse --short HEAD') do set GIT_VERSION=%GIT_VERSION%-%%I rem // Don't modify the file if it already has the current version. if exist "%GIT_VERSION_FILE%" ( diff --git a/rpcs3/Gui/AboutDialog.h b/rpcs3/Gui/AboutDialog.h index b3b133890c..aa1105ce18 100644 --- a/rpcs3/Gui/AboutDialog.h +++ b/rpcs3/Gui/AboutDialog.h @@ -36,7 +36,7 @@ AboutDialog::AboutDialog(wxWindow *parent) t_descr->SetForegroundColour(wxColor(255,255,255)); t_descr->SetPosition(wxPoint(12,50)); - wxStaticText* t_version = new wxStaticText(this, wxID_ANY, wxString::Format(_PRGNAME_" Version : " RPCS3_GIT_VERSION)); + wxStaticText* t_version = new wxStaticText(this, wxID_ANY, wxString::Format(_PRGNAME_" Version: " _PRGVER_ "-" RPCS3_GIT_VERSION)); t_version->SetBackgroundColour(wxColor(100,100,100)); t_version->SetForegroundColour(wxColor(200,200,200)); t_version->SetPosition(wxPoint(12,66)); diff --git a/rpcs3/Gui/MainFrame.cpp b/rpcs3/Gui/MainFrame.cpp index 9c61166ac0..8486b2bd7d 100644 --- a/rpcs3/Gui/MainFrame.cpp +++ b/rpcs3/Gui/MainFrame.cpp @@ -73,7 +73,7 @@ MainFrame::MainFrame() , m_sys_menu_opened(false) { - SetLabel(wxString::Format(_PRGNAME_ " " _PRGVER_ " " RPCS3_GIT_VERSION)); + SetLabel(wxString::Format(_PRGNAME_ " v" _PRGVER_ "-" RPCS3_GIT_VERSION)); wxMenuBar* menubar = new wxMenuBar(); @@ -165,7 +165,7 @@ MainFrame::MainFrame() wxGetApp().Bind(wxEVT_KEY_DOWN, &MainFrame::OnKeyDown, this); wxGetApp().Bind(wxEVT_DBG_COMMAND, &MainFrame::UpdateUI, this); - LOG_NOTICE(GENERAL, _PRGNAME_ " " _PRGVER_ " " RPCS3_GIT_VERSION); + LOG_NOTICE(GENERAL, _PRGNAME_ " v" _PRGVER_ "-" RPCS3_GIT_VERSION); LOG_NOTICE(GENERAL, ""); } diff --git a/rpcs3/git-version.cmake b/rpcs3/git-version.cmake index 3a764c50a4..a77a9ef5e0 100644 --- a/rpcs3/git-version.cmake +++ b/rpcs3/git-version.cmake @@ -4,14 +4,24 @@ set(GIT_VERSION_UPDATE "1") find_package(Git) if(GIT_FOUND) - execute_process(COMMAND ${GIT_EXECUTABLE} describe --always + execute_process(COMMAND ${GIT_EXECUTABLE} rev-list HEAD --count WORKING_DIRECTORY ${SOURCE_DIR} RESULT_VARIABLE exit_code OUTPUT_VARIABLE GIT_VERSION) if(NOT ${exit_code} EQUAL 0) - message(WARNING "git describe failed, unable to include version.") + message(WARNING "git rev-list failed, unable to include version.") + endif() + execute_process(COMMAND ${GIT_EXECUTABLE} rev-parse --short HEAD + WORKING_DIRECTORY ${SOURCE_DIR} + RESULT_VARIABLE exit_code + OUTPUT_VARIABLE GIT_VERSION_) + if(NOT ${exit_code} EQUAL 0) + message(WARNING "git rev-parse failed, unable to include version.") endif() string(STRIP ${GIT_VERSION} GIT_VERSION) + string(STRIP ${GIT_VERSION_} GIT_VERSION_) + string(STRIP ${GIT_VERSION}-${GIT_VERSION_} GIT_VERSION) + message(STATUS "GIT_VERSION: " ${GIT_VERSION}) else() message(WARNING "git not found, unable to include version.") endif() diff --git a/rpcs3/rpcs3.vcxproj b/rpcs3/rpcs3.vcxproj index 3494f1e499..37f0b8b2f2 100644 --- a/rpcs3/rpcs3.vcxproj +++ b/rpcs3/rpcs3.vcxproj @@ -223,7 +223,7 @@ false - "$(SolutionDir)\Utilities\git-version-gen.cmd" + %windir%\sysnative\cmd.exe /c "$(SolutionDir)\Utilities\git-version-gen.cmd" Updating git-version.h @@ -253,7 +253,7 @@ false - "$(SolutionDir)\Utilities\git-version-gen.cmd" + %windir%\sysnative\cmd.exe /c "$(SolutionDir)\Utilities\git-version-gen.cmd" Updating git-version.h @@ -283,7 +283,7 @@ false - "$(SolutionDir)\Utilities\git-version-gen.cmd" + %windir%\sysnative\cmd.exe /c "$(SolutionDir)\Utilities\git-version-gen.cmd" Updating git-version.h @@ -313,7 +313,7 @@ false - "$(SolutionDir)\Utilities\git-version-gen.cmd" + %windir%\sysnative\cmd.exe /c "$(SolutionDir)\Utilities\git-version-gen.cmd" Updating git-version.h @@ -343,7 +343,7 @@ false - "$(SolutionDir)\Utilities\git-version-gen.cmd" + %windir%\sysnative\cmd.exe /c "$(SolutionDir)\Utilities\git-version-gen.cmd" Updating git-version.h @@ -384,7 +384,7 @@ false - "$(SolutionDir)\Utilities\git-version-gen.cmd" + %windir%\sysnative\cmd.exe /c "$(SolutionDir)\Utilities\git-version-gen.cmd" Updating git-version.h @@ -422,7 +422,7 @@ false - "$(SolutionDir)\Utilities\git-version-gen.cmd" + %windir%\sysnative\cmd.exe /c "$(SolutionDir)\Utilities\git-version-gen.cmd" Updating git-version.h @@ -461,7 +461,7 @@ false - "$(SolutionDir)\Utilities\git-version-gen.cmd" + %windir%\sysnative\cmd.exe /c "$(SolutionDir)\Utilities\git-version-gen.cmd" Updating git-version.h @@ -500,7 +500,7 @@ false - "$(SolutionDir)\Utilities\git-version-gen.cmd" + %windir%\sysnative\cmd.exe /c "$(SolutionDir)\Utilities\git-version-gen.cmd" Updating git-version.h