message: Fix issue where git_tag_override would fail if "-" in tag name.
diff: @@ -164,14 +164,18 @@ def get_git_version(git_base_path, git_tag_override):
  "git", str("--git-dir=%s/.git" % git_base_path),
  str("--work-tree=" + git_base_path), "describe", "--long", "--tags"
  ]).strip())
  - if git_tag_override:
  + if git_tag_override and val:
  split_val = val.split("-")
  - if len(split_val) != 3:
  + if len(split_val) < 3:
  raise Exception(
  ("Expected git version in format 'TAG-COMMITS AFTER TAG-HASH' "
  "but got '%s'") % val)
  - split_val[0] = git_tag_override
  - val = bytes("-".join(split_val))
  + # There might be "-" in the tag name. But we can be sure that the final
  + # two "-" are those inserted by the git describe command.
  + commits_ahead_of_tag = split_val[-2]
  + abbrev_commit = split_val[-1]
  + val = bytes(
  + "-".join([git_tag_override, commits_ahead_of_tag, abbrev_commit]))
  return val if val else unknown_label
  except subprocess.CalledProcessError:
  return unknown_label
  