From d99400155b58c19dec37100a2db812d100001a7d Mon Sep 17 00:00:00 2001 From: Yatharth Agarwal Date: Tue, 23 Dec 2025 15:06:21 -0800 Subject: [PATCH] feat: show dry-run preview of what would be pushed to child repo in metta publish --- metta/setup/tools/publish.py | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/metta/setup/tools/publish.py b/metta/setup/tools/publish.py index 01436ceda6e..ccaa2dbb8d8 100644 --- a/metta/setup/tools/publish.py +++ b/metta/setup/tools/publish.py @@ -257,21 +257,20 @@ def _post_to_discord( def _push_git_history_to_child_repo(*, package: str, dry_run: bool) -> None: + dry_run_prefix = "[DRY RUN] " if dry_run else "" + info(f"{dry_run_prefix}Pushing filtered git history for {package} to child repo...") + + cmd = [f"{get_repo_root()}/devops/git/push_child_repo.py", package, "-y"] if dry_run: - info(f"Would push filtered git history for {package} to child repo.") - return + cmd.append("--dry-run") - info(f"Pushing filtered git history for {package} to child repo...") try: - subprocess.run( - [f"{get_repo_root()}/devops/git/push_child_repo.py", package, "-y"], - check=True, - ) + subprocess.run(cmd, check=True) except subprocess.CalledProcessError as exc: error(f"Failed to push to child repo: {exc}") raise typer.Exit(exc.returncode) from exc else: - success(f"Pushed filtered git history for {package} to child repo.") + success(f"{dry_run_prefix}Pushed filtered git history for {package} to child repo.") def _publish(