<html lang='en'>
<head>
<meta content='text/html; charset=utf-8' http-equiv='Content-Type'>
<title>
GitLab
</title>
</meta>
</head>
<style>
  img {
    max-width: 100%;
    height: auto;
  }
  p.details {
    font-style:italic;
    color:#777
  }
  .footer p {
    font-size:small;
    color:#777
  }
  pre.commit-message {
    white-space: pre-wrap;
  }
  .file-stats a {
    text-decoration: none;
  }
  .file-stats .new-file {
    color: #090;
  }
  .file-stats .deleted-file {
    color: #B00;
  }
</style>
<body>
<div class='content'>
<h3>Andrew Price pushed to branch master at <a href="https://projects.sucs.org/arthur/mw">Justin Mitchell / mw</a></h3>
<h4>
Commits:
</h4>
<ul>
<li>
<strong><a href="https://projects.sucs.org/arthur/mw/commit/9325a02dad4502362851faf40d1a8fe6b223bffc">9325a02d</a></strong>
<div>
<span>by Andrew Price</span>
<i>at 2016-01-15T18:35:02Z</i>
</div>
<pre class='commit-message'>Simplify version numbering using git tags

As we're determined to use git for providing version numbers we might as
well do it the right way. Take all of the version information from git
describe. This assumes that at least one annotated tag exists in the
branch relating to a release. The tag will be created using

$ git tag -a -m "Version 2.17" 2.17 fb1be771949e595952fdf83aac1c8649696d9f81

so git describe will give us versions like 2.17-123-gf00baa which has
better ordering properties than the current 2.17-gf00baa scheme, which
is important for package upgrades. When HEAD matches the tag exactly, it
will just give 2.17</pre>
</li>
<li>
<strong><a href="https://projects.sucs.org/arthur/mw/commit/79336cc6e46c88ba3c70f4208536afe9688ee491">79336cc6</a></strong>
<div>
<span>by Andrew Price</span>
<i>at 2016-01-15T18:37:19Z</i>
</div>
<pre class='commit-message'>Add -dirty to the version string if there are uncommitted changes</pre>
</li>
</ul>
<h4>7 changed files:</h4>
<ul>
<li class='file-stats'>
<a href='#diff-0'>
Makefile
</a>
</li>
<li class='file-stats'>
<a href='#diff-1'>
Makefile.common
</a>
</li>
<li class='file-stats'>
<a href='#diff-2'>
src/client/init.c
</a>
</li>
<li class='file-stats'>
<a href='#diff-3'>
src/client/js.c
</a>
</li>
<li class='file-stats'>
<a href='#diff-4'>
src/client/main.c
</a>
</li>
<li class='file-stats'>
<a href='#diff-5'>
src/client/script_inst.c
</a>
</li>
<li class='file-stats'>
<a href='#diff-6'>
src/server/servsock.c
</a>
</li>
</ul>
<h4>Changes:</h4>
<li id='diff-0'>
<a href='https://projects.sucs.org/arthur/mw/compare/cc3727d6eef5ef2781ef85a9a762a48935c04acc...79336cc6e46c88ba3c70f4208536afe9688ee491#diff-0'>
<strong>
Makefile
</strong>
</a>
<hr>
<pre class="highlight"><code><span style="color: #000000;background-color: #ffdddd">--- a/Makefile
</span><span style="color: #000000;background-color: #ddffdd">+++ b/Makefile
</span><span style="color: #aaaaaa">@@ -6,7 +6,7 @@ build:
</span>   $(MAKE) -C src $@
        $(MAKE) -C po $@
 
<span style="color: #000000;background-color: #ffdddd">-ifeq ($(SVNVER),)
</span><span style="color: #000000;background-color: #ddffdd">+ifeq ($(GITVER),)
</span> # These rules can only be called from inside an exported tree
 install:
        install -d $(DESTDIR)$(libdir)/mw
<span style="color: #aaaaaa">@@ -19,7 +19,7 @@ install:
</span> deb:
        cp -a debian-template debian
        dch --create --package mw3 -v $(VERSION) -c debian/changelog "Build mw3 $(VERSION) package"
<span style="color: #000000;background-color: #ffdddd">-        debuild -e VERSION_TWEAK=$(VERSION_TWEAK) -us -uc -b
</span><span style="color: #000000;background-color: #ddffdd">+   debuild -e VERSION=$(VERSION) -us -uc -b
</span> 
 tarball:
        tar zchvf ../$(MWVERSION).tar.gz -C .. $(MWVERSION)
<span style="color: #aaaaaa">@@ -35,7 +35,7 @@ export:
</span>   rm -rf $(TMPDIR)/$(MWVERSION)
        git checkout-index -a -f --prefix=$(TMPDIR)/$(MWVERSION)/
        # Store the git hash so we know it in the exported directory
<span style="color: #000000;background-color: #ffdddd">-        echo $(VERSION_TWEAK) > $(TMPDIR)/$(MWVERSION)/mw.rev
</span><span style="color: #000000;background-color: #ddffdd">+   echo $(GITVER) > $(TMPDIR)/$(MWVERSION)/mw.rev
</span> 
 install tarball rpm: export
        $(MAKE) -C $(TMPDIR)/$(MWVERSION) $@
</code></pre>

<br>
</li>
<li id='diff-1'>
<a href='https://projects.sucs.org/arthur/mw/compare/cc3727d6eef5ef2781ef85a9a762a48935c04acc...79336cc6e46c88ba3c70f4208536afe9688ee491#diff-1'>
<strong>
Makefile.common
</strong>
</a>
<hr>
<pre class="highlight"><code><span style="color: #000000;background-color: #ffdddd">--- a/Makefile.common
</span><span style="color: #000000;background-color: #ddffdd">+++ b/Makefile.common
</span><span style="color: #aaaaaa">@@ -1,23 +1,13 @@
</span> SHELL = /bin/bash
 
<span style="color: #000000;background-color: #ffdddd">-SVNVER = $(shell git describe --always )
-
-VERSION_MAJOR = 2
-VERSION_MINOR = 17
-
-ifeq ($(VERSION_TWEAK),)
-ifeq ($(SVNVER),)
-# mw.rev is created after an export so we can rely on it to provide the git hash here
-VERSION_TWEAK = $(shell cat $(SRCROOT)/mw.rev)
-else
-ifeq ($(SVNVER),0)
-$(warning failed to get git revision. VERSION_TWEAK will be set to 0)
-endif
-VERSION_TWEAK = $(SVNVER)
-endif
</span><span style="color: #000000;background-color: #ddffdd">+GITVER = $(shell git describe --always --dirty)
+VERSION = $(GITVER)
+
+ifeq ($(VERSION),)
+# mw.rev is created after an export so we can rely on it to provide the version here
+VERSION = $(shell cat $(SRCROOT)/mw.rev)
</span> endif
 
<span style="color: #000000;background-color: #ffdddd">-VERSION = $(VERSION_MAJOR).$(VERSION_MINOR).$(VERSION_TWEAK)
</span> MWVERSION = mw3-$(VERSION)
 
 prefix ?= /usr
<span style="color: #aaaaaa">@@ -58,9 +48,7 @@ endif
</span> # info strings, do not edit.
 DEFS:= -DBUILD_DATE=\"$(shell date +%Y%m%d)\"
 DEFS+= -DBUILD_USER=\"$(shell whoami | sed 's/^./\u&/')\"
<span style="color: #000000;background-color: #ffdddd">-DEFS+= -DVER_MAJ=\"$(VERSION_MAJOR)\"
-DEFS+= -DVER_MIN=\"$(VERSION_MINOR)\"
-DEFS+= -DVER_TWK=\"$(VERSION_TWEAK)\"
</span><span style="color: #000000;background-color: #ddffdd">+DEFS+= -DVERSION=\"$(VERSION)\"
</span> DEFS+= -DHOMEPATH=\"$(HOMEPATH)\"
 DEFS+= -DLOGDIR=\"$(LOGDIR)\"
 DEFS+= -DSTATEDIR=\"$(STATEDIR)\"
</code></pre>

<br>
</li>
<li id='diff-2'>
<a href='https://projects.sucs.org/arthur/mw/compare/cc3727d6eef5ef2781ef85a9a762a48935c04acc...79336cc6e46c88ba3c70f4208536afe9688ee491#diff-2'>
<strong>
src/client/init.c
</strong>
</a>
<hr>
<pre class="highlight"><code><span style="color: #000000;background-color: #ffdddd">--- a/src/client/init.c
</span><span style="color: #000000;background-color: #ddffdd">+++ b/src/client/init.c
</span><span style="color: #aaaaaa">@@ -66,10 +66,7 @@ static int ReadInitFile(const char *base, const char *filename)
</span>           curl_easy_setopt(cl, CURLOPT_WRITEDATA, file);
                curl_easy_setopt(cl, CURLOPT_URL, filename);
                curl_easy_setopt(cl, CURLOPT_ERRORBUFFER, cerr);
<span style="color: #000000;background-color: #ffdddd">-                if (atoi(VER_TWK) > 0)
-                       curl_easy_setopt(cl, CURLOPT_USERAGENT, "Milliways III v" VER_MAJ "." VER_MIN "." VER_TWK);
-               else
-                       curl_easy_setopt(cl, CURLOPT_USERAGENT, "Milliways III v" VER_MAJ "." VER_MIN);
</span><span style="color: #000000;background-color: #ddffdd">+           curl_easy_setopt(cl, CURLOPT_USERAGENT, "Milliways III v" VERSION);
</span>           if (curl_easy_perform(cl))
                        fprintf(stderr, "Error loading %s: %s\n", filename, cerr);
                curl_easy_cleanup(cl);
</code></pre>

<br>
</li>
<li id='diff-3'>
<a href='https://projects.sucs.org/arthur/mw/compare/cc3727d6eef5ef2781ef85a9a762a48935c04acc...79336cc6e46c88ba3c70f4208536afe9688ee491#diff-3'>
<strong>
src/client/js.c
</strong>
</a>
<hr>
<pre class="highlight"><code><span style="color: #000000;background-color: #ffdddd">--- a/src/client/js.c
</span><span style="color: #000000;background-color: #ddffdd">+++ b/src/client/js.c
</span><span style="color: #aaaaaa">@@ -780,10 +780,7 @@ static JSBool js_urlget(JSContext *cx, unsigned int argc, jsval *vp)
</span>           curl_easy_setopt(cl, CURLOPT_WRITEDATA, answer);
                curl_easy_setopt(cl, CURLOPT_URL, url);
                curl_easy_setopt(cl, CURLOPT_ERRORBUFFER, cerr);
<span style="color: #000000;background-color: #ffdddd">-                if (atoi(VER_TWK) > 0)
-                       curl_easy_setopt(cl, CURLOPT_USERAGENT, "Milliways III v" VER_MAJ "." VER_MIN "." VER_TWK);
-               else
-                       curl_easy_setopt(cl, CURLOPT_USERAGENT, "Milliways III v" VER_MAJ "." VER_MIN);
</span><span style="color: #000000;background-color: #ddffdd">+           curl_easy_setopt(cl, CURLOPT_USERAGENT, "Milliways III v" VERSION);
</span>           if (curl_easy_perform(cl)) {
                        snprintf(msg, MAXTEXTLENGTH-1, "JavaScript urlget failed %s: %s", url, cerr);
                        js_warning(cx, msg);
</code></pre>

<br>
</li>
<li id='diff-4'>
<a href='https://projects.sucs.org/arthur/mw/compare/cc3727d6eef5ef2781ef85a9a762a48935c04acc...79336cc6e46c88ba3c70f4208536afe9688ee491#diff-4'>
<strong>
src/client/main.c
</strong>
</a>
<hr>
<pre class="highlight"><code><span style="color: #000000;background-color: #ffdddd">--- a/src/client/main.c
</span><span style="color: #000000;background-color: #ddffdd">+++ b/src/client/main.c
</span><span style="color: #aaaaaa">@@ -51,7 +51,7 @@
</span> #include "who.h"
 #include "alias.h"
 
<span style="color: #000000;background-color: #ffdddd">-static char version[]="Milliways III - Release "VER_MAJ"."VER_MIN"."VER_TWK"\n";
</span><span style="color: #000000;background-color: #ddffdd">+static char version[]="Milliways III - Release "VERSION"\n";
</span> 
 /* global termcap usage variable */
 int g_boTermCap = 0;
<span style="color: #aaaaaa">@@ -1858,10 +1858,7 @@ char *part_comm_mesg(const char *text, int status)
</span> 
 void c_version(CommandList *cm, int argc, const char **argv, char *args)
 {
<span style="color: #000000;background-color: #ffdddd">-        if (atoi(VER_TWK) > 0)
-       printf(_("Version %s.%s.%s\n"), VER_MAJ, VER_MIN, VER_TWK);
-       else
-       printf(_("Version %s.%s\n"), VER_MAJ, VER_MIN);
</span><span style="color: #000000;background-color: #ddffdd">+   printf(_("Version "VERSION"\n"));
</span>   printf(_("Built by %s on %s\n"), BUILD_USER, __DATE__);
 }
 
</code></pre>

<br>
</li>
<li id='diff-5'>
<a href='https://projects.sucs.org/arthur/mw/compare/cc3727d6eef5ef2781ef85a9a762a48935c04acc...79336cc6e46c88ba3c70f4208536afe9688ee491#diff-5'>
<strong>
src/client/script_inst.c
</strong>
</a>
<hr>
<pre class="highlight"><code><span style="color: #000000;background-color: #ffdddd">--- a/src/client/script_inst.c
</span><span style="color: #000000;background-color: #ddffdd">+++ b/src/client/script_inst.c
</span><span style="color: #aaaaaa">@@ -2032,15 +2032,14 @@ void scr_user( struct code *pc, int fargc, char **fargv )
</span> void scr_version( struct code *pc, int fargc, char **fargv )
 {
        char *what;
<span style="color: #000000;background-color: #ffdddd">-        const char *version_str = "R "VER_MAJ" "VER_MIN;
</span> 
        if (pc->argc < 1) {
                if (script_debug) printf("Error in %s at %s too few arguments.\n", pc->inst->name, pc->debug);
                return;
        }
        what=eval_arg(pc->argv[0], fargc, fargv);
<span style="color: #000000;background-color: #ffdddd">-        if (script_debug) printf(" - VERSION: Version string is '%s'", version_str);
-       var_str_force_2(what, version_str);
</span><span style="color: #000000;background-color: #ddffdd">+   if (script_debug) printf(" - VERSION: Version string is '%s'", VERSION);
+       var_str_force_2(what, VERSION);
</span>   free(what);
 }
 
</code></pre>

<br>
</li>
<li id='diff-6'>
<a href='https://projects.sucs.org/arthur/mw/compare/cc3727d6eef5ef2781ef85a9a762a48935c04acc...79336cc6e46c88ba3c70f4208536afe9688ee491#diff-6'>
<strong>
src/server/servsock.c
</strong>
</a>
<hr>
<pre class="highlight"><code><span style="color: #000000;background-color: #ffdddd">--- a/src/server/servsock.c
</span><span style="color: #000000;background-color: #ddffdd">+++ b/src/server/servsock.c
</span><span style="color: #aaaaaa">@@ -311,9 +311,7 @@ void process_msg(ipc_connection_t *conn, ipc_message_t *msg)
</span> 
                json_t * j = json_init(NULL);
                json_addint(j, "uptime", now - uptime);
<span style="color: #000000;background-color: #ffdddd">-                _autofree char *version = NULL;
-               asprintf(&version, "%s.%s.%s", VER_MAJ, VER_MIN, VER_TWK);
-               json_addstring(j, "version", version);
</span><span style="color: #000000;background-color: #ddffdd">+           json_addstring(j, "version", VERSION);
</span>           ipcmsg_json_encode(msg, j);
                msg_attach(msg, conn);
                ipcmsg_destroy(msg);
</code></pre>

<br>
</li>

</div>
<div class='footer' style='margin-top: 10px;'>
<p>

<br>
<a href="https://projects.sucs.org/arthur/mw/compare/cc3727d6eef5ef2781ef85a9a762a48935c04acc...79336cc6e46c88ba3c70f4208536afe9688ee491">View it on GitLab</a>.
<br>
You're receiving this email because of your account on projects.sucs.org.
If you'd like to receive fewer emails, you can adjust your notification settings.

</p>
</div>
</body>
</html>