'Determines the next semver tag for the repository at the path.
If the commit at HEAD is already tagged with a tag matching --tag_regex_str,
this function is a no-op. Otherwise it determines the semantic version bump
for the commits since the last tag matching \'version-X.Y.Z\' and suggests a new tag
based on the commit messages. This suggestion can be overridden with
--next_tag, which will be used if there are any commits after the last
semver tag matching \'version-X.Y.Z\'.
Returns:
[VersionBump]: Next semantic version tag to be used, along with what type
of version bump it was. Version tag is of the form \'version-X.Y.Z\'.'

def determine_new_tag(self):

    if self.__next_tag:
        return VersionBump(self.__next_tag, self.get_head_commit())
    log_onelines = run_quick('git    -C    {path}    log    --pretty=oneline'.format(path=self.path), echo=False).stdout.strip().split('\n')
    commit_hashes = [line.split('    ')[0].strip() for line in log_onelines]
    msgs = [run_quick('git    -C    {path}    log    -n    1    --pretty=medium    {hash}'.format(path=self.path, hash=h), echo=False).stdout.strip() for h in commit_hashes]
    if (len(commit_hashes) != len(msgs)):
        raise IOError('Git    commit    hash    list    and    commit    message    list    are    unequal    sizes.')
    return self.bump_semver(self.__current_version, commit_hashes, msgs)
