'Return the branch name, the tag name or the revision identifier.
The result could be used as ref in a git repo, e.g. for linking to
GitHub or Bitbucket.'

@property
def commit_name(self):

    if (self.slug == LATEST):
        if self.project.default_branch:
            return self.project.default_branch
        return self.project.vcs_repo().fallback_branch
    if (self.slug == STABLE):
        if (self.type == BRANCH):
            if self.identifier.startswith('origin/'):
                return self.identifier[len('origin/'):]
        return self.identifier
    assert (self.slug not in NON_REPOSITORY_VERSIONS)
    if (self.type in (BRANCH, TAG)):
        return self.verbose_name
    return self.identifier
