Problem:
Build fails without git or .git/.
ref #19289
Solution:
Fix the version generation logic.
Test cases:
If `git` is missing:
-- Using NVIM_VERSION_MEDIUM: v0.8.0-dev
If `.git/` is missing:
-- Git tag extraction failed:
fatal: not a git repository (or any of the parent directories): .git
-- Using NVIM_VERSION_MEDIUM: v0.8.0-dev
If `git describe` fails
-- Git tag extraction failed:
fatal: ...
-- Using NVIM_VERSION_MEDIUM: v0.8.0-dev
Co-authored-by: Justin M. Keyes <justinkz@gmail.com>
- only update git-version if both of these conditions are met:
- `git` command succeeds
- `versiondef_git.h` would change (SHA1-diff)
- else print a status/warning message
also move version generation out of Lua into cmake.