def parse_gerrit_remote_url(url):
    """Break Gerrit remote url into host, port and project"""
    # We are expecting a remote URL in the format
    # protocol://host:port/project
    split_url = url.split('/')
    project = '/'.join(split_url[3:])   # The project part can contain slashes
    host_port = split_url[2].split(':')
    host = host_port[0]
    if len(host_port) > 1:
        port = host_port[1]
    else:
        port = '29418'        # Default Gerrit port
    return host, port, project