about summary refs log tree commit diff stats
path: root/src
diff options
context:
space:
mode:
authorJames Booth <boothj5@gmail.com>2013-09-17 01:28:35 +0100
committerJames Booth <boothj5@gmail.com>2013-09-17 01:28:35 +0100
commitee8ff948bfc1a21a10ea7e5bb34fffde781624e6 (patch)
tree4281e6df297974791d6221dd003bb48e02575bb0 /src
parent90d5df9ef7c83066251e8e02dae33441f8bb0a4b (diff)
downloadprofani-tty-ee8ff948bfc1a21a10ea7e5bb34fffde781624e6.tar.gz
Use git revision in development strings
Diffstat (limited to 'src')
-rw-r--r--src/profanity.c10
-rw-r--r--src/ui/core.c11
-rw-r--r--src/xmpp/capabilities.c11
-rw-r--r--src/xmpp/iq.c11
4 files changed, 42 insertions, 1 deletions
diff --git a/src/profanity.c b/src/profanity.c
index 4e9e887c..b18cbe91 100644
--- a/src/profanity.c
+++ b/src/profanity.c
@@ -22,6 +22,10 @@
 
 #include "config.h"
 
+#ifdef HAVE_GIT_VERSION
+#include "gitversion.c"
+#endif
+
 #include <locale.h>
 #include <signal.h>
 #include <stdlib.h>
@@ -615,7 +619,11 @@ _init(const int disable_tls, char *log_level)
     log_level_t prof_log_level = log_level_from_string(log_level);
     log_init(prof_log_level);
     if (strcmp(PACKAGE_STATUS, "development") == 0) {
-        log_info("Starting Profanity (%sdev)...", PACKAGE_VERSION);
+#ifdef HAVE_GIT_VERSION
+            log_info("Starting Profanity (%sdev.%s.%s)...", PACKAGE_VERSION, PROF_GIT_BRANCH, PROF_GIT_REVISION);
+#else
+            log_info("Starting Profanity (%sdev)...", PACKAGE_VERSION);
+#endif
     } else {
         log_info("Starting Profanity (%s)...", PACKAGE_VERSION);
     }
diff --git a/src/ui/core.c b/src/ui/core.c
index 16c1d2ff..6b415a2b 100644
--- a/src/ui/core.c
+++ b/src/ui/core.c
@@ -22,6 +22,10 @@
 
 #include "config.h"
 
+#ifdef HAVE_GIT_VERSION
+#include "gitversion.c"
+#endif
+
 #include <stdlib.h>
 #include <string.h>
 #ifdef HAVE_LIBXSS
@@ -1375,7 +1379,14 @@ _ui_draw_win_title(void)
         g_string_append(version_str, " ");
         g_string_append(version_str, PACKAGE_VERSION);
         if (strcmp(PACKAGE_STATUS, "development") == 0) {
+#ifdef HAVE_GIT_VERSION
+            g_string_append(version_str, "dev.");
+            g_string_append(version_str, PROF_GIT_BRANCH);
+            g_string_append(version_str, ".");
+            g_string_append(version_str, PROF_GIT_REVISION);
+#else
             g_string_append(version_str, "dev");
+#endif
         }
     }
 
diff --git a/src/xmpp/capabilities.c b/src/xmpp/capabilities.c
index f38a2749..658be124 100644
--- a/src/xmpp/capabilities.c
+++ b/src/xmpp/capabilities.c
@@ -22,6 +22,10 @@
 
 #include "config.h"
 
+#ifdef HAVE_GIT_VERSION
+#include "gitversion.c"
+#endif
+
 #include <stdlib.h>
 #include <string.h>
 
@@ -238,7 +242,14 @@ caps_create_query_response_stanza(xmpp_ctx_t * const ctx)
     GString *name_str = g_string_new("Profanity ");
     g_string_append(name_str, PACKAGE_VERSION);
     if (strcmp(PACKAGE_STATUS, "development") == 0) {
+#ifdef HAVE_GIT_VERSION
+        g_string_append(name_str, "dev.");
+        g_string_append(name_str, PROF_GIT_BRANCH);
+        g_string_append(name_str, ".");
+        g_string_append(name_str, PROF_GIT_REVISION);
+#else
         g_string_append(name_str, "dev");
+#endif
     }
     xmpp_stanza_set_attribute(identity, "name", name_str->str);
 
diff --git a/src/xmpp/iq.c b/src/xmpp/iq.c
index 8eb4d99e..1ddfcb34 100644
--- a/src/xmpp/iq.c
+++ b/src/xmpp/iq.c
@@ -22,6 +22,10 @@
 
 #include "config.h"
 
+#ifdef HAVE_GIT_VERSION
+#include "gitversion.c"
+#endif
+
 #include <stdlib.h>
 #include <string.h>
 
@@ -236,7 +240,14 @@ _iq_handle_version_get(xmpp_conn_t * const conn, xmpp_stanza_t * const stanza,
         xmpp_stanza_t *version_txt = xmpp_stanza_new(ctx);
         GString *version_str = g_string_new(PACKAGE_VERSION);
         if (strcmp(PACKAGE_STATUS, "development") == 0) {
+#ifdef HAVE_GIT_VERSION
+            g_string_append(version_str, "dev.");
+            g_string_append(version_str, PROF_GIT_BRANCH);
+            g_string_append(version_str, ".");
+            g_string_append(version_str, PROF_GIT_REVISION);
+#else
             g_string_append(version_str, "dev");
+#endif
         }
         xmpp_stanza_set_text(version_txt, version_str->str);
         xmpp_stanza_add_child(version, version_txt);