def METHOD_NAME(ctx, message, output_format, datasets):
    """Delete one or more datasets in the Kart repository, and commit the result"""
    if not datasets:
        raise click.UsageError("Specify a dataset to delete: eg `kart data rm DATASET`")
    repo = ctx.obj.get_repo()
    existing_ds_paths = set(repo.datasets().paths())
    for ds_path in datasets:
        if ds_path not in existing_ds_paths:
            raise NotFound(
                f"Cannot delete dataset at path '{ds_path}' since it does not exist",
                exit_code=NO_TABLE,
            )
    repo.working_copy.check_not_dirty()
    repo_diff = RepoDiff()
    for ds_path in datasets:
        dataset = repo.datasets()[ds_path]
        ds_diff = DatasetDiff()
        ds_diff["meta"] = DeltaDiff.diff_dicts(dataset.meta_items(), {})
        ds_diff["feature"] = dataset.all_features_diff(delta_type=Delta.delete)
        repo_diff[ds_path] = ds_diff
    do_json = output_format == "json"
    if message:
        commit_msg = "\n\n".join([m.strip() for m in message]).strip()
    else:
        commit_msg = get_commit_message(repo, repo_diff, quiet=do_json)
    if not commit_msg:
        raise click.UsageError("Aborting commit due to empty commit message.")
    new_commit = repo.structure().commit_diff(repo_diff, commit_msg)
    repo.working_copy.reset_to_head()
    jdict = commit_obj_to_json(new_commit, repo, repo_diff)
    if do_json:
        dump_json_output(jdict, sys.stdout)
    else:
        click.echo(commit_json_to_text(jdict))
    repo.gc("--auto")