Permalink
Browse files

#994 Add git revision info to @version and version().

  • Loading branch information...
1 parent 037ac9a commit a7641327986f09bf3cca94ace62afbb59edcafa9 @tkrajcar tkrajcar committed May 7, 2015
Showing with 34 additions and 38 deletions.
  1. +1 −0 .gitignore
  2. +1 −0 CHANGES.186
  3. +1 −1 I18N
  4. +9 −6 Makefile.in
  5. +1 −0 game/txt/hlp/pennv186.hlp
  6. +3 −8 po/hr_HR.pox
  7. +3 −8 po/nl_NL.pox
  8. +3 −8 po/no_NO.pox
  9. +2 −7 po/pennmush.pot
  10. +2 −0 src/Makefile.in
  11. +4 −0 src/funmisc.c
  12. +4 −0 src/version.c
View
@@ -24,6 +24,7 @@ game/save
hdrs/buildinf.h
hdrs/cmds.h
hdrs/funs.h
+hdrs/gitinfo.h
options.h
src/Makefile
src/cmdlocal.c
View
@@ -29,3 +29,4 @@ Hardcode:
release being 2003. [SW]
* Remove ancient @channel foo=on behavior (issue #870). Reported by
Paige. [TK]
+ * Add git revision, if present to @version & version(). [TK]
View
@@ -35,7 +35,7 @@ the running server).
Files with messages for translation are included with the source
code in pennmush/po; they have the .pox extension. You can get
-the very latest versions of these files from the PennMUSH svn repository.
+the very latest versions of these files from the PennMUSH Git repository.
These files have to be compiled to an efficient internal form before
starting up the mush. This means you should set your LANG environment
View
@@ -53,7 +53,7 @@ options.h: options.h.dist
@echo "Please use 'make update' to set/update your MUSH configuration in options.h and the game/*.cnf files."
@exit 1
-autogen: hdrs/cmds.h hdrs/funs.h hdrs/switches.h
+autogen: hdrs/cmds.h hdrs/funs.h hdrs/switches.h hdrs/gitinfo.h
hdrs/cmds.h: src/cmds.c src/command.c src/cque.c src/help.c src/set.c src/sql.c Patchlevel
@PERL@ utils/mkcmds.pl commands
@@ -67,6 +67,12 @@ src/switchinc.c: src/SWITCHES Patchlevel
hdrs/funs.h: src/fun*.c src/bsd.c src/conf.c src/extmail.c src/help.c src/markup.c src/wiz.c src/sql.c Patchlevel src/cque.c
@PERL@ utils/mkcmds.pl functions
+hdrs/gitinfo.h: $(wildcard .git/HEAD .git/index)
+ @if [ -f ".git/HEAD" ]; then \
+ echo "#define GIT_REVISION \"$(shell git rev-parse --short HEAD)\"" > $@; \
+ fi
+ @echo "/* Built at `date +%Y%m%d%H%M%S` */" >> hdrs/gitinfo.h
+
install: localized all
-rm -f game/netmush
-rm -f game/info_slave
@@ -99,7 +105,7 @@ ssl_slave:
"LDFLAGS=$(LDFLAGS)" "CLIBS=$(CLIBS)" "MAKE=$(MAKE)" \
"MAKEFLAGS=$(MAKEFLAGS)")
-versions: CHANGES*
+versions: CHANGES* hdrs/gitinfo.h
-@rm -rf CHANGES*~ CHANGES*bak
@utils/mkvershlp.pl game/txt/hlp CHANGES*
@@ -171,7 +177,7 @@ clean:
(cd game; rm -f netmush info_slave)
distclean:
- (cd hdrs; rm -f *.orig *~ \#* *.rej *.bak funs.h cmds.h buildinf.h)
+ (cd hdrs; rm -f *.orig *~ \#* *.rej *.bak funs.h cmds.h gitinfo.h buildinf.h)
(cd utils; rm -f *.orig *~ \#* *.rej *.bak mkcmds.sh *.o)
(cd game; rm -rf *.log netmush info_slave *.orig *.rej *~ *.bak mush.cnf)
(cd src; make distclean; rm -f Makefile)
@@ -183,9 +189,6 @@ totallyclean: distclean
(cd src; rm -rf *.rej)
-rm -f Makefile
-commit: indent
- @svn commit
-
patch: versions
@make-patch-header
@make diffs
@@ -26,3 +26,4 @@ Hardcode:
release being 2003. [SW]
* Remove ancient @channel foo=on behavior (issue #870). Reported by
Paige. [TK]
+ * Add git revision, if present to @version & version(). [TK]
View
@@ -4625,15 +4625,10 @@ msgstr "SQL: Zahva
msgid "SQL: Error: %s"
msgstr "SQL: Gre�ka: %s"
-#: version.c:50
+#: version.c:41
#, c-format
-msgid "SVN revision: %d [%s]"
-msgstr "SVN revizija: %d [%s]"
-
-#: version.c:52 version.c:54
-#, c-format
-msgid "SVN revision: %d"
-msgstr "SVN revizija: %d"
+msgid "Git revision: %s"
+msgstr "Git revizija: %s"
#: src/wiz.c:1471
#, c-format
View
@@ -4557,15 +4557,10 @@ msgstr "SQL: %d rijen beinvloed."
msgid "SQL: Error: %s"
msgstr "SQL: Fout: %s"
-#: version.c:50
+#: version.c:41
#, c-format
-msgid "SVN revision: %d [%s]"
-msgstr "SVN revisie: %d [%s]"
-
-#: version.c:52 version.c:54
-#, c-format
-msgid "SVN revision: %d"
-msgstr "SVN revisie: %d"
+msgid "Git revision: %s"
+msgstr "Git revisie: %s"
#: src/wiz.c:1471
#, c-format
View
@@ -4191,15 +4191,10 @@ msgstr "SQL: %d rader p
msgid "SQL: Error: %s"
msgstr "SQL: Feil: %s"
-#: version.c:50
+#: version.c:41
#, c-format
-msgid "SVN revision: %d [%s]"
-msgstr "SVN revisjon: %d [%s]"
-
-#: version.c:52 version.c:54
-#, c-format
-msgid "SVN revision: %d"
-msgstr "SVN revisjon: %d"
+msgid "Git revision: %s
+msgstr "Git revisjon: %s"
#: src/wiz.c:1471
#, c-format
View
@@ -6494,14 +6494,9 @@ msgstr ""
msgid "PennMUSH version %s patchlevel %s %s"
msgstr ""
-#: version.c:53
+#: version.c:41
#, c-format
-msgid "SVN revision: %d [%s]"
-msgstr ""
-
-#: version.c:55 version.c:57
-#, c-format
-msgid "SVN revision: %d"
+msgid "Git revision: %s"
msgstr ""
#: version.c:64 version.c:66
View
@@ -1016,6 +1016,7 @@ funmisc.o: ../hdrs/memcheck.h
funmisc.o: ../hdrs/mymalloc.h
funmisc.o: ../hdrs/parse.h
funmisc.o: ../hdrs/strutil.h
+funmisc.o: ../hdrs/gitinfo.h
funmisc.o: ../hdrs/version.h
funstr.o: ../config.h
funstr.o: ../confmagic.h
@@ -2030,6 +2031,7 @@ version.o: ../hdrs/notify.h
version.o: ../hdrs/strutil.h
version.o: ../hdrs/compile.h
version.o: ../hdrs/buildinf.h
+version.o: ../hdrs/gitinfo.h
wait.o: ../config.h
wait.o: ../confmagic.h
wait.o: ../options.h
View
@@ -32,6 +32,7 @@
#include "parse.h"
#include "strtree.h"
#include "strutil.h"
+#include "gitinfo.h"
#include "version.h"
#ifdef WIN32
@@ -1133,6 +1134,9 @@ FUNCTION(fun_version)
{
safe_format(buff, bp, "PennMUSH version %s patchlevel %s %s",
VERSION, PATCHLEVEL, PATCHDATE);
+ #ifdef GIT_REVISION
+ safe_format(buff, bp, " (rev %s)", GIT_REVISION);
+ #endif
}
/* ARGSUSED */
View
@@ -16,6 +16,7 @@
#include "conf.h"
#include "notify.h"
#include "strutil.h"
+#include "gitinfo.h"
#ifndef WIN32
#include "buildinf.h"
@@ -36,6 +37,9 @@ do_version(dbref player)
show_time(globals.start_time, 0));
notify_format(player, T("PennMUSH version %s patchlevel %s %s"), VERSION,
PATCHLEVEL, PATCHDATE);
+#ifdef GIT_REVISION
+ notify_format(player, T("Git revision: %s"), GIT_REVISION);
+#endif
#ifdef WIN32
notify_format(player, T("Build date: %s"), __DATE__);
#else

0 comments on commit a764132

Please sign in to comment.