Form the LSST the Docs edition name for this branch, using the same
    logic as LTD Keeper does for transforming branch names into edition names.

    Parameters
    ----------
    git_ref_name : `str`
       Name of the git branch (or git ref, in general, like a tag) that.

    Notes
    -----
    The LTD Keeper (github.com/lsst-sqre/ltd-keeper) logic is being replicated
    here because Keeper is server side code and this is client-side and it's
    not yet clear this warrants being refactored into a common dependency.

    See ``keeper.utils.auto_slugify_edition``.

def form_ltd_edition_name(git_ref_name=None):
    """Form the LSST the Docs edition name for this branch, using the same
    logic as LTD Keeper does for transforming branch names into edition names.

    Parameters
    ----------
    git_ref_name : `str`
       Name of the git branch (or git ref, in general, like a tag) that.

    Notes
    -----
    The LTD Keeper (github.com/lsst-sqre/ltd-keeper) logic is being replicated
    here because Keeper is server side code and this is client-side and it's
    not yet clear this warrants being refactored into a common dependency.

    See ``keeper.utils.auto_slugify_edition``.
    """
    if git_ref_name is None:
        name = read_git_branch()
    else:
        name = git_ref_name

    # First, try to use the JIRA ticket number
    m = TICKET_BRANCH_PATTERN.match(name)
    if m is not None:
        return m.group(1)

    # Or use a tagged version
    m = TAG_PATTERN.match(name)
    if m is not None:
        return name

    if name == 'master':
        # using this terminology for LTD Dasher
        name = 'Current'

    # Otherwise, reproduce the LTD slug
    name = name.replace('/', '-')
    name = name.replace('_', '-')
    name = name.replace('.', '-')
    return name