From 0d490a1316dcfdd62fd65c264b052c85f6a7d4a5 Mon Sep 17 00:00:00 2001 From: hauntsaninja Date: Tue, 4 Oct 2022 14:53:16 -0700 Subject: [PATCH 1/2] stubsabot: add some debug logs For #8778 --- scripts/stubsabot.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/scripts/stubsabot.py b/scripts/stubsabot.py index d67454916802..c1cdd68c576d 100644 --- a/scripts/stubsabot.py +++ b/scripts/stubsabot.py @@ -511,8 +511,10 @@ async def create_or_update_pull_request(*, title: str, body: str, branch_name: s def has_non_stubsabot_commits(branch: str) -> bool: assert not branch.startswith("origin/") try: - # number of commits on origin/branch that are not on branch or are + # commits on origin/branch that are not on branch or are # patch equivalent to a commit on branch + print("[debugprint]", subprocess.check_output(["git", "log", "--right-only", "--pretty=%an %s", "--cherry-pick", f"{branch}...origin/{branch}"])) + print("[debugprint]", subprocess.check_output(["git", "log", "--right-only", "--pretty=%an", "--cherry-pick", f"{branch}...origin/{branch}"])) output = subprocess.check_output( ["git", "log", "--right-only", "--pretty=%an", "--cherry-pick", f"{branch}...origin/{branch}"], stderr=subprocess.DEVNULL, @@ -529,7 +531,7 @@ class RemoteConflict(Exception): def somewhat_safe_force_push(branch: str) -> None: if has_non_stubsabot_commits(branch): - raise RemoteConflict(f"origin/{branch} has changes not on {branch}!") + raise RemoteConflict(f"origin/{branch} has non-stubsabot changes that are not on {branch}!") subprocess.check_call(["git", "push", "origin", branch, "--force"]) From 930dca756970100985d4acdd423c4ab4344d74d1 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 4 Oct 2022 21:55:38 +0000 Subject: [PATCH 2/2] [pre-commit.ci] auto fixes from pre-commit.com hooks --- scripts/stubsabot.py | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/scripts/stubsabot.py b/scripts/stubsabot.py index c1cdd68c576d..fce2eb9b6817 100644 --- a/scripts/stubsabot.py +++ b/scripts/stubsabot.py @@ -513,8 +513,18 @@ def has_non_stubsabot_commits(branch: str) -> bool: try: # commits on origin/branch that are not on branch or are # patch equivalent to a commit on branch - print("[debugprint]", subprocess.check_output(["git", "log", "--right-only", "--pretty=%an %s", "--cherry-pick", f"{branch}...origin/{branch}"])) - print("[debugprint]", subprocess.check_output(["git", "log", "--right-only", "--pretty=%an", "--cherry-pick", f"{branch}...origin/{branch}"])) + print( + "[debugprint]", + subprocess.check_output( + ["git", "log", "--right-only", "--pretty=%an %s", "--cherry-pick", f"{branch}...origin/{branch}"] + ), + ) + print( + "[debugprint]", + subprocess.check_output( + ["git", "log", "--right-only", "--pretty=%an", "--cherry-pick", f"{branch}...origin/{branch}"] + ), + ) output = subprocess.check_output( ["git", "log", "--right-only", "--pretty=%an", "--cherry-pick", f"{branch}...origin/{branch}"], stderr=subprocess.DEVNULL,