meson.build: make git version string less confusing

compton built from the git repo often _seems_ to be from a older release,
this change disambiguate the version string.

compton built from the git repo now have version string like this:
'vgit-xxxxx'

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
This commit is contained in:
Yuxuan Shui 2019-07-30 22:22:21 +01:00
parent 6cb5f9711e
commit ea6f355a6b
No known key found for this signature in database
GPG Key ID: 37C999F617EA1A47
1 changed files with 2 additions and 2 deletions

View File

@ -9,9 +9,9 @@ version = 'v'+meson.project_version()
# use git describe if that's available
git = find_program('git', required: false)
if git.found()
gitv = run_command('git', 'describe')
gitv = run_command('git', 'rev-parse', '--short=5', 'HEAD')
if gitv.returncode() == 0
version = gitv.stdout().strip()
version = 'vgit-'+gitv.stdout().strip()
endif
endif