diff --git a/generated/meson.build b/generated/meson.build index 4d1d8ef..61b7b4b 100644 --- a/generated/meson.build +++ b/generated/meson.build @@ -1,6 +1,7 @@ version_override = get_option('override-version') if version_override == '' - version_header = vcs_tag(command: ['git', 'describe', '--dirty', '--broken'], input: 'version.hh.in', output: 'version.hh', fallback: meson.project_version()) + # See the contents of meson_git_describe_wrapper.sh for explanation of its use + version_header = vcs_tag(command: 'meson_git_describe_wrapper.sh', input: 'version.hh.in', output: 'version.hh', fallback: meson.project_version()) else conf_data = configuration_data() conf_data.set('VCS_TAG', version_override) diff --git a/generated/meson_git_describe_wrapper.sh b/generated/meson_git_describe_wrapper.sh new file mode 100755 index 0000000..23a0277 --- /dev/null +++ b/generated/meson_git_describe_wrapper.sh @@ -0,0 +1,10 @@ +#!/bin/sh +# The following command would normally print an error message if not run in a +# git repository (e.g. when run in an extracted release archive, which doesn't +# include git history). +# J4dd's build system is configured to handle git failures well. If git isn't +# available or if we're not in a git repository, version.txt is used to +# determine the version. +# Because this behavior is fully supported, printing an error message would only +# confuse the user, because the error message implies that something is wrong. +exec git describe --dirty --broken 2> /dev/null