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
This commit is contained in:
Justin M. Keyes
2014-10-07 05:45:05 +00:00
parent 2c2fee4d1f
commit a1901941f8
5 changed files with 41 additions and 6 deletions

View File

@@ -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.