def METHOD_NAME(query):
    options = get_json_param(query.jso, "markup", "git", None)
    options: Options = Options.load(options)
    if options is None:
        raise ValueError("No git markup attribute present with git")
    defaults = get_json_param(query.jso, "markup", "gitDefaults", {})
    if "url" not in defaults or not defaults["url"]:
        raise ValueError("git url not specified in gitDefaults")
    settings: Settings = Settings.load(defaults)
    info = RemoteInfo.parse_url(settings.url, settings)
    lib = get_lib(info, settings)
    return lib, options