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

@@ -18,9 +18,8 @@
#include "nvim/version_defs.h"
char *Version = VIM_VERSION_SHORT;
char *longVersion = NVIM_VERSION_LONG_DATE __DATE__ " " __TIME__ ")";
char *longVersion = NVIM_VERSION_LONG " (compiled " __DATE__ " " __TIME__ ")";
char *version_commit = "Commit: " NVIM_VERSION_COMMIT;
#ifdef INCLUDE_GENERATED_DECLARATIONS
# include "version.c.generated.h"
@@ -747,6 +746,7 @@ void list_version(void)
// When adding features here, don't forget to update the list of
// internal variables in eval.c!
MSG(longVersion);
MSG(version_commit);
// Print the list of extra patch descriptions if there is at least one.
char *s = "";