mirror of
https://github.com/neovim/neovim.git
synced 2026-01-22 05:04:51 +10:00
When building in a git repo:
- If HEAD corresponds to an annotated tag, (i.e. git_get_exact_tag()
returns truthy) the current build is considered a "release" build:
NVIM_VERSION_MEDIUM is directly assigned the tagged version name,
and NVIM_VERSION_* defines are ignored.
- If HEAD is not a tagged release, then NVIM_VERSION_MEDIUM is
directly assigned the result of `git describe`.
If git (or the repo) is not available:
- The NVIM_VERSION_* defines are used to define NVIM_VERSION_MEDIUM.
Sample outputs for `nvim --version` and `nvim +version`:
Building with git @ non-tagged commit e66df14:
NVIM v0.1.0-1-ge66df14 (compiled Nov 1 2015 19:10:30)
Commit: e66df148f9401be17adab324a6e41d927aae20b3
Building with git @ v0.1.1 tag:
NVIM v0.1.1 (compiled Nov 1 2015 19:03:52)
[no "Commit:" line]
Building this commit _not_ in a git repo:
NVIM 0.1.0-dev (compiled Nov 1 2015 19:16:11)
[no "Commit:" line]
24 lines
632 B
C
24 lines
632 B
C
#ifndef NVIM_VERSION_H
|
|
#define NVIM_VERSION_H
|
|
|
|
// defined in version.c
|
|
extern char* Version;
|
|
extern char* longVersion;
|
|
|
|
//
|
|
// Vim version number, name, etc. Patchlevel is defined in version.c.
|
|
//
|
|
#define VIM_VERSION_MAJOR 7
|
|
#define VIM_VERSION_MINOR 4
|
|
#define VIM_VERSION_100 (VIM_VERSION_MAJOR * 100 + VIM_VERSION_MINOR)
|
|
|
|
// used for the runtime directory name
|
|
#define VIM_VERSION_NODOT "vim74"
|
|
// swap file compatibility (max. length is 6 chars)
|
|
#define VIM_VERSION_SHORT "7.4"
|
|
|
|
#ifdef INCLUDE_GENERATED_DECLARATIONS
|
|
# include "version.h.generated.h"
|
|
#endif
|
|
#endif // NVIM_VERSION_H
|