def get_git_version(self, strip_v_in_version: bool=True) -> str:
    '\n        Gets application version in the format [last-tag]-[last-commit-sha].\n        :param strip_v_in_version: If the version tag starts with \'v\' (like \'v1.2.3),\n        this chooses if the \'v\' should be stripped, so the resulting tag is \'1.2.3\'.\n        If there\'s a "-", "." or "_" separator after "v", it is removed as well.\n        :return: The version string\n        '
    if (not self._is_repo):
        raise git.exc.InvalidGitRepositoryError()
    tags = sorted(self._repo.tags, key=(lambda t: t.commit.committed_date))
    latest_tag = (None if (len(tags) == 0) else tags[(- 1)])
    ver = ('0.0.0' if (latest_tag is None) else latest_tag.name)
    if (strip_v_in_version and ver.startswith('v')):
        txt_ver = ver.lstrip('v')
        txt_ver = txt_ver.lstrip('-_.')
    else:
        txt_ver = ver
    sha = self._repo.head.commit.hexsha
    if ((latest_tag is not None) and (sha == latest_tag.commit.hexsha)):
        return txt_ver
    return f'{txt_ver}-{sha}'
Gets application version in the format [last-tag]-[last-commit-sha].
:param strip_v_in_version: If the version tag starts with 'v' (like 'v1.2.3),
this chooses if the 'v' should be stripped, so the resulting tag is '1.2.3'.
If there's a "-", "." or "_" separator after "v", it is removed as well.
:return: The version string
def get_git_version(self, strip_v_in_version: bool=True) -> str:
    '\n        Gets application version in the format [last-tag]-[last-commit-sha].\n        :param strip_v_in_version: If the version tag starts with \'v\' (like \'v1.2.3),\n        this chooses if the \'v\' should be stripped, so the resulting tag is \'1.2.3\'.\n        If there\'s a "-", "." or "_" separator after "v", it is removed as well.\n        :return: The version string\n        '
    if (not self._is_repo):
        raise git.exc.InvalidGitRepositoryError()
    tags = sorted(self._repo.tags, key=(lambda t: t.commit.committed_date))
    latest_tag = (None if (len(tags) == 0) else tags[(- 1)])
    ver = ('0.0.0' if (latest_tag is None) else latest_tag.name)
    if (strip_v_in_version and ver.startswith('v')):
        txt_ver = ver.lstrip('v')
        txt_ver = txt_ver.lstrip('-_.')
    else:
        txt_ver = ver
    sha = self._repo.head.commit.hexsha
    if ((latest_tag is not None) and (sha == latest_tag.commit.hexsha)):
        return txt_ver
    return f'{txt_ver}-{sha}'