aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJustin M. Keyes <justinkz@gmail.com>2015-12-13 03:00:09 -0500
committerJustin M. Keyes <justinkz@gmail.com>2015-12-13 03:00:09 -0500
commit8a34d21b0d8e06edfbe02d47e4f045e0e97c996e (patch)
tree2b87c48e76a6e7ce51f59b605f23ef37302146b6
parent7387816dcb650bbacb3ea0a51307066055249286 (diff)
parent7be12edd38b1da0a506f39651d8c6a6f9aa5626a (diff)
downloadrneovim-8a34d21b0d8e06edfbe02d47e4f045e0e97c996e.tar.gz
rneovim-8a34d21b0d8e06edfbe02d47e4f045e0e97c996e.tar.bz2
rneovim-8a34d21b0d8e06edfbe02d47e4f045e0e97c996e.zip
Merge pull request #3706 from Pyrohh/version_commit
Remove "Commit:" field from `--version` output
-rw-r--r--CMakeLists.txt18
-rw-r--r--config/versiondef.h.in1
-rw-r--r--src/nvim/version.c6
3 files changed, 3 insertions, 22 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index f06d060560..6c471ece71 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -46,27 +46,15 @@ if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE "Dev" CACHE STRING "Choose the type of build." FORCE)
endif()
-# Version tokens
-# - In a git repo, these tokens are _ignored_.
-# - If the current HEAD is tagged, the tag name is used.
-# - Otherwise the result of `git describe` is used.
-# - If not in a git repo (e.g. a tarball) these tokens set the version string.
+# If not in a git repo (e.g., a tarball) these tokens set the version string,
+# otherwise the result of `git describe` is used.
set(NVIM_VERSION_MAJOR 0)
set(NVIM_VERSION_MINOR 1)
set(NVIM_VERSION_PATCH 1)
file(TO_CMAKE_PATH ${CMAKE_CURRENT_LIST_DIR}/.git FORCED_GIT_DIR)
include(GetGitRevisionDescription)
-get_git_head_revision(GIT_REFSPEC NVIM_VERSION_COMMIT)
-if(NVIM_VERSION_COMMIT) # is a git repo
- git_get_exact_tag(NVIM_VERSION_MEDIUM)
- if(NVIM_VERSION_MEDIUM) # is a tagged release
- unset(NVIM_VERSION_COMMIT)
- else() # is a dev build
- git_describe(NVIM_VERSION_MEDIUM)
- get_git_head_revision(GIT_REFSPEC NVIM_VERSION_COMMIT)
- endif()
-endif()
+git_describe(NVIM_VERSION_MEDIUM)
set(NVIM_VERSION_BUILD_TYPE "${CMAKE_BUILD_TYPE}")
# NVIM_VERSION_CFLAGS set further below.
diff --git a/config/versiondef.h.in b/config/versiondef.h.in
index 7f37ef72fb..c91bb29c90 100644
--- a/config/versiondef.h.in
+++ b/config/versiondef.h.in
@@ -5,7 +5,6 @@
#define NVIM_VERSION_MINOR @NVIM_VERSION_MINOR@
#define NVIM_VERSION_PATCH @NVIM_VERSION_PATCH@
#define NVIM_VERSION_PRERELEASE "@NVIM_VERSION_PRERELEASE@"
-#cmakedefine NVIM_VERSION_COMMIT "@NVIM_VERSION_COMMIT@"
#cmakedefine NVIM_VERSION_MEDIUM "@NVIM_VERSION_MEDIUM@"
#define NVIM_VERSION_CFLAGS "@NVIM_VERSION_CFLAGS@"
diff --git a/src/nvim/version.c b/src/nvim/version.c
index e0f378b156..c340211b02 100644
--- a/src/nvim/version.c
+++ b/src/nvim/version.c
@@ -37,9 +37,6 @@ char *Version = VIM_VERSION_SHORT;
char *longVersion = NVIM_VERSION_LONG;
char *longVersionWithDate = NVIM_VERSION_LONG \
" (compiled " __DATE__ " " __TIME__ ")";
-#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;
@@ -1099,9 +1096,6 @@ 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);