mirror of
https://github.com/neovim/neovim.git
synced 2024-12-19 18:55:14 -07:00
Remove "Commit:" field from --version
output
If nvim is built from a non-tagged commit, the truncated commit hash is already appended to the main version string (e.g., "NVIM v0.1.0-83-g959f260 ..."), making the "Commit:" field redundant. Regarding the truncated hash length: we don't have nearly enough commits to worry about collisions, and probably won't ever, so the default length should be fine.
This commit is contained in:
parent
4a1c36e953
commit
7be12edd38
@ -46,27 +46,15 @@ if(NOT CMAKE_BUILD_TYPE)
|
|||||||
set(CMAKE_BUILD_TYPE "Dev" CACHE STRING "Choose the type of build." FORCE)
|
set(CMAKE_BUILD_TYPE "Dev" CACHE STRING "Choose the type of build." FORCE)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# Version tokens
|
# If not in a git repo (e.g., a tarball) these tokens set the version string,
|
||||||
# - In a git repo, these tokens are _ignored_.
|
# otherwise the result of `git describe` is used.
|
||||||
# - 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.
|
|
||||||
set(NVIM_VERSION_MAJOR 0)
|
set(NVIM_VERSION_MAJOR 0)
|
||||||
set(NVIM_VERSION_MINOR 1)
|
set(NVIM_VERSION_MINOR 1)
|
||||||
set(NVIM_VERSION_PATCH 1)
|
set(NVIM_VERSION_PATCH 1)
|
||||||
|
|
||||||
file(TO_CMAKE_PATH ${CMAKE_CURRENT_LIST_DIR}/.git FORCED_GIT_DIR)
|
file(TO_CMAKE_PATH ${CMAKE_CURRENT_LIST_DIR}/.git FORCED_GIT_DIR)
|
||||||
include(GetGitRevisionDescription)
|
include(GetGitRevisionDescription)
|
||||||
get_git_head_revision(GIT_REFSPEC NVIM_VERSION_COMMIT)
|
git_describe(NVIM_VERSION_MEDIUM)
|
||||||
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()
|
|
||||||
|
|
||||||
set(NVIM_VERSION_BUILD_TYPE "${CMAKE_BUILD_TYPE}")
|
set(NVIM_VERSION_BUILD_TYPE "${CMAKE_BUILD_TYPE}")
|
||||||
# NVIM_VERSION_CFLAGS set further below.
|
# NVIM_VERSION_CFLAGS set further below.
|
||||||
|
@ -5,7 +5,6 @@
|
|||||||
#define NVIM_VERSION_MINOR @NVIM_VERSION_MINOR@
|
#define NVIM_VERSION_MINOR @NVIM_VERSION_MINOR@
|
||||||
#define NVIM_VERSION_PATCH @NVIM_VERSION_PATCH@
|
#define NVIM_VERSION_PATCH @NVIM_VERSION_PATCH@
|
||||||
#define NVIM_VERSION_PRERELEASE "@NVIM_VERSION_PRERELEASE@"
|
#define NVIM_VERSION_PRERELEASE "@NVIM_VERSION_PRERELEASE@"
|
||||||
#cmakedefine NVIM_VERSION_COMMIT "@NVIM_VERSION_COMMIT@"
|
|
||||||
#cmakedefine NVIM_VERSION_MEDIUM "@NVIM_VERSION_MEDIUM@"
|
#cmakedefine NVIM_VERSION_MEDIUM "@NVIM_VERSION_MEDIUM@"
|
||||||
|
|
||||||
#define NVIM_VERSION_CFLAGS "@NVIM_VERSION_CFLAGS@"
|
#define NVIM_VERSION_CFLAGS "@NVIM_VERSION_CFLAGS@"
|
||||||
|
@ -37,9 +37,6 @@ char *Version = VIM_VERSION_SHORT;
|
|||||||
char *longVersion = NVIM_VERSION_LONG;
|
char *longVersion = NVIM_VERSION_LONG;
|
||||||
char *longVersionWithDate = NVIM_VERSION_LONG \
|
char *longVersionWithDate = NVIM_VERSION_LONG \
|
||||||
" (compiled " __DATE__ " " __TIME__ ")";
|
" (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_buildtype = "Build type: " NVIM_VERSION_BUILD_TYPE;
|
||||||
char *version_cflags = "Compilation: " NVIM_VERSION_CFLAGS;
|
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
|
// When adding features here, don't forget to update the list of
|
||||||
// internal variables in eval.c!
|
// internal variables in eval.c!
|
||||||
MSG(longVersionWithDate);
|
MSG(longVersionWithDate);
|
||||||
#ifdef NVIM_VERSION_COMMIT
|
|
||||||
MSG(version_commit);
|
|
||||||
#endif
|
|
||||||
MSG(version_buildtype);
|
MSG(version_buildtype);
|
||||||
MSG(version_cflags);
|
MSG(version_cflags);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user