Fix: git version build system integration (v2)
[lttng-tools.git] / src / bin / lttng / commands / version.c
index 8631cf9482cce8f853fa4dd8530a6c1f9bf600da..f4d89631e7e5a13dfc1a42a6e5aa5d7767d3bacc 100644 (file)
@@ -65,7 +65,7 @@ static void create_version(struct mi_lttng_version *version)
        version->version_major = VERSION_MAJOR;
        version->version_minor = VERSION_MINOR;
        version->version_patchlevel = VERSION_PATCHLEVEL;
-       strncpy(version->version_commit, FULL_VERSION, NAME_MAX);
+       strncpy(version->version_commit, GIT_VERSION, NAME_MAX);
        strncpy(version->version_name, VERSION_NAME, NAME_MAX);
        strncpy(version->package_url, PACKAGE_URL, NAME_MAX);
 }
@@ -164,7 +164,8 @@ int cmd_version(int argc, const char **argv)
        if (lttng_opt_mi) {
                ret = print_mi();
        } else {
-               MSG("lttng version " FULL_VERSION " - " VERSION_NAME);
+               MSG("lttng version " VERSION " - " VERSION_NAME "%s",
+                       GIT_VERSION[0] == '\0' ? "" : " - " GIT_VERSION);
                MSG("\n" VERSION_DESCRIPTION "\n");
                MSG("Web site: http://lttng.org");
                MSG("\n%s", lttng_license);
This page took 0.0242 seconds and 4 git commands to generate.