From a83020922d0dcdde4ca29394342901ea4bc71e8f Mon Sep 17 00:00:00 2001 From: Florian Walch Date: Mon, 28 Sep 2015 12:17:19 +0200 Subject: version: Prepare for releases. * Hide commit information from --version if we can't find any (e.g. when building from tarball). To define a release in CMake, set NVIM_VERSION_PRERELEASE to "". This will modify --version output to: * Show annotated Git tag instead of commit hash (NVIM_VERSION_COMMIT). * Hide commit date (NVIM_VERSION_BUILD). --- src/nvim/version.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src') diff --git a/src/nvim/version.c b/src/nvim/version.c index 7cc72705b6..c8cbcf2439 100644 --- a/src/nvim/version.c +++ b/src/nvim/version.c @@ -36,7 +36,9 @@ char *Version = VIM_VERSION_SHORT; char *longVersion = NVIM_VERSION_LONG; char *longVersionWithDate = NVIM_VERSION_LONG " (compiled " __DATE__ " " __TIME__ ")"; char *mediumVersion = NVIM_VERSION_MEDIUM; +#ifdef NVIM_VERSION_COMMIT char *version_commit = "Commit: " NVIM_VERSION_COMMIT; +#endif char *version_buildtype = "Build type: " NVIM_VERSION_BUILD_TYPE; char *version_cflags = "Compilation: " NVIM_VERSION_CFLAGS; @@ -1024,7 +1026,9 @@ void list_version(void) // When adding features here, don't forget to update the list of // internal variables in eval.c! MSG(longVersionWithDate); +#ifdef NVIM_VERSION_COMMIT MSG(version_commit); +#endif MSG(version_buildtype); MSG(version_cflags); -- cgit