def METHOD_NAME(globs: Sequence[str], workdir: str, to: str) -> str:
    changes = subprocess.run(
        [
            "git",
            "diff",
            "--diff-filter=AM",
            "--name-only",
            f"{to}...",
            "--",
            *globs,
            *[f":(exclude){allowed}" for allowed in ALLOWED_MIGRATIONS_GLOBS],
        ],
        stdout=subprocess.PIPE,
        text=True,
        cwd=workdir,
    )
    if changes.returncode != 0:
        raise ExecError(changes.stdout)
    else:
        return changes.stdout