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
  • Loading branch information
DomGries committed Sep 1, 2015
1 parent a1ffc9e commit c77da80
Show file tree
Hide file tree
Showing 15 changed files with 188 additions and 382 deletions.
526 changes: 178 additions & 348 deletions contrib/git_id/git_id.cpp

Large diffs are not rendered by default.

5 changes: 2 additions & 3 deletions src/game/Level0.cpp
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
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 @@ -2387,13 +2385,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
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 @@ -103,7 +102,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 @@ -178,7 +177,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
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
Expand Up @@ -100,7 +100,6 @@ set(LIBRARY_SRCS
Common.cpp
Common.h
LockedQueue.h
revision_nr.h
revision_sql.h
SystemConfig.h
Threading.cpp
Expand Down
6 changes: 3 additions & 3 deletions src/shared/SystemConfig.h.in
Expand Up @@ -27,9 +27,9 @@

#ifndef _VERSION
#if PLATFORM == PLATFORM_WINDOWS
# define _VERSION(REVD,REVT,REVN,REVH) "0.17" " (" REVD " " REVT " Revision " REVN " - " REVH ")"
# define _VERSION(REVD,REVT,REVH) "0.17" " (" REVD " " REVT " - " REVH ")"
#else
# define _VERSION(REVD,REVT,REVN,REVH) "@VERSION@" " (" REVD " " REVT " Revision " REVN " - " REVH ")"
# define _VERSION(REVD,REVT,REVH) "@VERSION@" " (" REVD " " REVT " - " REVH ")"
#endif
#endif

Expand Down 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,REVH) _PACKAGENAME "/" _VERSION(REVD,REVT,REVH) " 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
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
Expand Up @@ -482,7 +482,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
Expand Up @@ -172,7 +172,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
Expand Up @@ -488,7 +488,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
Expand Up @@ -172,7 +172,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
Expand Up @@ -488,7 +488,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
Expand Up @@ -172,7 +172,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 c77da80

Please sign in to comment.