diff options
author | Justin M. Keyes <justinkz@gmail.com> | 2014-10-07 05:45:05 +0000 |
---|---|---|
committer | Justin M. Keyes <justinkz@gmail.com> | 2014-10-07 10:23:15 +0000 |
commit | a1901941f8de5de54e0da1fe314d92bf705bca38 (patch) | |
tree | 8db30c8d48da2b316444d6f52fefb01c04371ce0 /src | |
parent | 2c2fee4d1f510791c4c0a7021f11c7be820c7adb (diff) | |
download | rneovim-a1901941f8de5de54e0da1fe314d92bf705bca38.tar.gz rneovim-a1901941f8de5de54e0da1fe314d92bf705bca38.tar.bz2 rneovim-a1901941f8de5de54e0da1fe314d92bf705bca38.zip |
version: generate "build number" from commit timestamp
- cmake: git_timestamp() returns last commit time formatted as
`YYYYMMddHHmm`.
- Always include commit hash in :version and --version output.
`nvim --version` sample output:
NVIM 0.0.0-alpha+201410070245 (compiled Oct 7 2014 05:30:45)
Commit: f747b2b1ff7bfe7eb00cc2be82d7af87c98f1111
Diffstat (limited to 'src')
-rw-r--r-- | src/nvim/version.c | 6 | ||||
-rw-r--r-- | src/nvim/version_defs.h | 4 |
2 files changed, 6 insertions, 4 deletions
diff --git a/src/nvim/version.c b/src/nvim/version.c index 0af28fcdca..a79ef47e7e 100644 --- a/src/nvim/version.c +++ b/src/nvim/version.c @@ -18,9 +18,8 @@ #include "nvim/version_defs.h" char *Version = VIM_VERSION_SHORT; - -char *longVersion = NVIM_VERSION_LONG_DATE __DATE__ " " __TIME__ ")"; - +char *longVersion = NVIM_VERSION_LONG " (compiled " __DATE__ " " __TIME__ ")"; +char *version_commit = "Commit: " NVIM_VERSION_COMMIT; #ifdef INCLUDE_GENERATED_DECLARATIONS # include "version.c.generated.h" @@ -747,6 +746,7 @@ void list_version(void) // When adding features here, don't forget to update the list of // internal variables in eval.c! MSG(longVersion); + MSG(version_commit); // Print the list of extra patch descriptions if there is at least one. char *s = ""; diff --git a/src/nvim/version_defs.h b/src/nvim/version_defs.h index 9257580dac..d8e1b4ea82 100644 --- a/src/nvim/version_defs.h +++ b/src/nvim/version_defs.h @@ -27,11 +27,13 @@ #ifndef NVIM_VERSION_BUILD #define NVIM_VERSION_BUILD #endif +#ifndef NVIM_VERSION_COMMIT +#define NVIM_VERSION_COMMIT +#endif // for the startup-screen #define NVIM_VERSION_MEDIUM STR(NVIM_VERSION_MAJOR) "." STR(NVIM_VERSION_MINOR) // for the ":version" command and "nvim -h" #define NVIM_VERSION_LONG "NVIM " NVIM_VERSION_MEDIUM "." STR(NVIM_VERSION_PATCH) NVIM_VERSION_PRERELEASE NVIM_VERSION_BUILD -#define NVIM_VERSION_LONG_DATE NVIM_VERSION_LONG " (compiled " // // Vim version number, name, etc. Patchlevel is defined in version.c. |