Skip to content

Commit

Permalink
Use git_id for sql updates only
Browse files Browse the repository at this point in the history
This tool hinders workflow and is only useful for database updates. git_id will now silently exit except if new sql updates are found in which case it does the usual git_id sql magic.

Notes for devs:
* You need to rebuild git_id.exe
* Keep in mind that as before you need to push to remote between commits with sql updates as the last version is checked using the git remote
* There is no longer any version check between script library (ScriptDev2) and core

Advantages:
* Reduce amount of change conflicts
* Able to merge PRs using github UI
* Less of a hassle when working in git with rebases, branches, etc.
* Make backporting easier and more fun

(based on commit c77da80)

(based on cmangos/mangos-tbc@5b52695)
  • Loading branch information
DomGries committed Sep 2, 2015
1 parent 8e91126 commit 6b58904
Show file tree
Hide file tree
Showing 15 changed files with 33 additions and 242 deletions.
235 changes: 25 additions & 210 deletions contrib/git_id/git_id.cpp

Large diffs are not rendered by default.

5 changes: 2 additions & 3 deletions src/game/Level0.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
#include "ScriptMgr.h"
#include "SystemConfig.h"
#include "revision.h"
#include "revision_nr.h"
#include "Util.h"

bool ChatHandler::HandleHelpCommand(char* args)
Expand Down Expand Up @@ -97,9 +96,9 @@ bool ChatHandler::HandleServerInfoCommand(char* /*args*/)

char const* full;
if (m_session)
full = _FULLVERSION(REVISION_DATE, REVISION_TIME, REVISION_NR, "|cffffffff|Hurl:" REVISION_ID "|h" REVISION_ID "|h|r");
full = _FULLVERSION(REVISION_DATE, REVISION_TIME, "|cffffffff|Hurl:" REVISION_ID "|h" REVISION_ID "|h|r");
else
full = _FULLVERSION(REVISION_DATE, REVISION_TIME, REVISION_NR, REVISION_ID);
full = _FULLVERSION(REVISION_DATE, REVISION_TIME, REVISION_ID);
SendSysMessage(full);

if (sScriptMgr.IsScriptLibraryLoaded())
Expand Down
9 changes: 0 additions & 9 deletions src/game/ScriptMgr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,6 @@
#include "WaypointMovementGenerator.h"
#include "Mail.h"

#include "revision_nr.h"

ScriptMapMapName sQuestEndScripts;
ScriptMapMapName sQuestStartScripts;
ScriptMapMapName sSpellScripts;
Expand Down Expand Up @@ -2358,13 +2356,6 @@ ScriptLoadResult ScriptMgr::LoadScriptLibrary(const char* libName)

# undef GET_SCRIPT_HOOK_PTR

if (strcmp(pGetMangosRevStr(), REVISION_NR) != 0)
{
m_pOnFreeScriptLibrary = NULL; // prevent call before init
UnloadScriptLibrary();
return SCRIPT_LOAD_ERR_OUTDATED;
}

m_pOnInitScriptLibrary();
return SCRIPT_LOAD_OK;
}
Expand Down
5 changes: 2 additions & 3 deletions src/mangosd/Main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
#include "SystemConfig.h"
#include "AuctionHouseBot/AuctionHouseBot.h"
#include "revision.h"
#include "revision_nr.h"
#include <openssl/opensslv.h>
#include <openssl/crypto.h>
#include <ace/Version.h>
Expand Down Expand Up @@ -104,7 +103,7 @@ extern int main(int argc, char** argv)
cfg_file = cmd_opts.opt_arg();
break;
case 'v':
printf("%s\n", _FULLVERSION(REVISION_DATE, REVISION_TIME, REVISION_NR, REVISION_ID));
printf("%s\n", _FULLVERSION(REVISION_DATE, REVISION_TIME, REVISION_ID));
return 0;
case 's':
{
Expand Down Expand Up @@ -179,7 +178,7 @@ extern int main(int argc, char** argv)
}
#endif

sLog.outString("%s [world-daemon]", _FULLVERSION(REVISION_DATE, REVISION_TIME, REVISION_NR, REVISION_ID));
sLog.outString("%s [world-daemon]", _FULLVERSION(REVISION_DATE, REVISION_TIME, REVISION_ID));
sLog.outString("<Ctrl-C> to stop.");
sLog.outString("\n\n"
" _____ __ __ _ _ _____ ____ _____ \n"
Expand Down
5 changes: 2 additions & 3 deletions src/realmd/Main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
#include "AuthSocket.h"
#include "SystemConfig.h"
#include "revision.h"
#include "revision_nr.h"
#include "revision_sql.h"
#include "Util.h"
#include <openssl/opensslv.h>
Expand Down Expand Up @@ -107,7 +106,7 @@ extern int main(int argc, char** argv)
cfg_file = cmd_opts.opt_arg();
break;
case 'v':
printf("%s\n", _FULLVERSION(REVISION_DATE, REVISION_TIME, REVISION_NR, REVISION_ID));
printf("%s\n", _FULLVERSION(REVISION_DATE, REVISION_TIME, REVISION_ID));
return 0;

case 's':
Expand Down Expand Up @@ -185,7 +184,7 @@ extern int main(int argc, char** argv)

sLog.Initialize();

sLog.outString("%s [realm-daemon]", _FULLVERSION(REVISION_DATE, REVISION_TIME, REVISION_NR, REVISION_ID));
sLog.outString("%s [realm-daemon]", _FULLVERSION(REVISION_DATE, REVISION_TIME, REVISION_ID));
sLog.outString("<Ctrl-C> to stop.\n");
sLog.outString("Using configuration file %s.", cfg_file);

Expand Down
1 change: 0 additions & 1 deletion src/shared/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,6 @@ set(LIBRARY_SRCS
Common.cpp
Common.h
LockedQueue.h
revision_nr.h
revision_sql.h
Threading.cpp
Threading.h
Expand Down
2 changes: 1 addition & 1 deletion src/shared/SystemConfig.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@
# define _AUCTIONHOUSEBOT_CONFIG SYSCONFDIR"ahbot.conf"
#endif

#define _FULLVERSION(REVD,REVT,REVN,REVH) _PACKAGENAME "/" _VERSION(REVD,REVT,REVN,REVH) " for " _ENDIAN_PLATFORM
#define _FULLVERSION(REVD,REVT,REVN) _PACKAGENAME "/" _VERSION(REVD,REVT,REVN) " for " _ENDIAN_PLATFORM

#define DEFAULT_PLAYER_LIMIT 100
#define DEFAULT_WORLDSERVER_PORT 8085 //8129
Expand Down
3 changes: 1 addition & 2 deletions src/shared/WheatyExceptionReport.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
#include <dbghelp.h>
#include "WheatyExceptionReport.h"
#include "revision.h"
#include "revision_nr.h"
#define CrashFolder _T("Crashes")
//#pragma comment(linker, "/defaultlib:dbghelp.lib")

Expand Down Expand Up @@ -299,7 +298,7 @@ void WheatyExceptionReport::GenerateExceptionReport(
GetLocalTime(&systime);

// Start out with a banner
_tprintf(_T("Revision: %s %s %s %s\r\n"), REVISION_DATE, REVISION_TIME, REVISION_NR, REVISION_ID);
_tprintf(_T("Revision: %s %s %s\r\n"), REVISION_DATE, REVISION_TIME, REVISION_ID);
_tprintf(_T("Date %u:%u:%u. Time %u:%u \r\n"), systime.wDay, systime.wMonth, systime.wYear, systime.wHour, systime.wMinute);
PEXCEPTION_RECORD pExceptionRecord = pExceptionInfo->ExceptionRecord;

Expand Down
4 changes: 0 additions & 4 deletions src/shared/revision_nr.h

This file was deleted.

1 change: 0 additions & 1 deletion win/VC100/shared.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -480,7 +480,6 @@
<ClInclude Include="..\..\src\shared\LockedQueue.h" />
<ClInclude Include="..\..\src\shared\Log.h" />
<ClInclude Include="..\..\src\shared\ProgressBar.h" />
<ClInclude Include="..\..\src\shared\revision_nr.h" />
<ClInclude Include="..\..\src\shared\revision_sql.h" />
<ClInclude Include="..\..\src\shared\ServiceWin32.h" />
<ClInclude Include="..\..\src\shared\Threading.h" />
Expand Down
1 change: 0 additions & 1 deletion win/VC100/shared.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,6 @@
</ClInclude>
<ClInclude Include="..\..\src\shared\Common.h" />
<ClInclude Include="..\..\src\shared\LockedQueue.h" />
<ClInclude Include="..\..\src\shared\revision_nr.h" />
<ClInclude Include="..\..\src\shared\revision_sql.h" />
<ClInclude Include="..\..\src\shared\ServiceWin32.h" />
<ClInclude Include="..\..\src\shared\Threading.h" />
Expand Down
1 change: 0 additions & 1 deletion win/VC110/shared.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -486,7 +486,6 @@
<ClInclude Include="..\..\src\shared\LockedQueue.h" />
<ClInclude Include="..\..\src\shared\Log.h" />
<ClInclude Include="..\..\src\shared\ProgressBar.h" />
<ClInclude Include="..\..\src\shared\revision_nr.h" />
<ClInclude Include="..\..\src\shared\revision_sql.h" />
<ClInclude Include="..\..\src\shared\ServiceWin32.h" />
<ClInclude Include="..\..\src\shared\Threading.h" />
Expand Down
1 change: 0 additions & 1 deletion win/VC110/shared.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,6 @@
</ClInclude>
<ClInclude Include="..\..\src\shared\Common.h" />
<ClInclude Include="..\..\src\shared\LockedQueue.h" />
<ClInclude Include="..\..\src\shared\revision_nr.h" />
<ClInclude Include="..\..\src\shared\revision_sql.h" />
<ClInclude Include="..\..\src\shared\ServiceWin32.h" />
<ClInclude Include="..\..\src\shared\Threading.h" />
Expand Down
1 change: 0 additions & 1 deletion win/VC120/shared.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -486,7 +486,6 @@
<ClInclude Include="..\..\src\shared\LockedQueue.h" />
<ClInclude Include="..\..\src\shared\Log.h" />
<ClInclude Include="..\..\src\shared\ProgressBar.h" />
<ClInclude Include="..\..\src\shared\revision_nr.h" />
<ClInclude Include="..\..\src\shared\revision_sql.h" />
<ClInclude Include="..\..\src\shared\ServiceWin32.h" />
<ClInclude Include="..\..\src\shared\Threading.h" />
Expand Down
1 change: 0 additions & 1 deletion win/VC120/shared.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,6 @@
</ClInclude>
<ClInclude Include="..\..\src\shared\Common.h" />
<ClInclude Include="..\..\src\shared\LockedQueue.h" />
<ClInclude Include="..\..\src\shared\revision_nr.h" />
<ClInclude Include="..\..\src\shared\revision_sql.h" />
<ClInclude Include="..\..\src\shared\ServiceWin32.h" />
<ClInclude Include="..\..\src\shared\Threading.h" />
Expand Down

0 comments on commit 6b58904

Please sign in to comment.