fix(upstream): preserve selected refs in companion commands (#591)

* fix(upstream): preserve selected refs in companion commands

* fix(upstream): quote companion command arguments

* docs(changelog): record fix for #591
This commit is contained in:
Rudy Mizrahi Celekli authored and GitHub committed 2026-10-18 07:26:10 +02:00
1 parent 239dad775b
commit 5a29fdc711
4 files changed
+76 -5

No files matched your search

+2 -1
View File
@@ -15,6 +15,7 @@ from __future__ import annotations
import argparse
import os
import re
import shlex
import subprocess
import sys
from pathlib import Path
@@ -189,7 +190,7 @@ def main() -> int:
# answers "which upstream commits deserve review". Point at the companion.
print(
f"\nFor commit-level triage of upstream commits, run: "
f"python3 tools/upstream_triage.py --remote {remote}"
f"python3 tools/upstream_triage.py --remote {shlex.quote(remote)} --branch {shlex.quote(args.branch)}"
)
return 0
+5 -4
View File
@@ -33,6 +33,7 @@ the upstream ref is unavailable, so a scheduled job degrades gracefully.
from __future__ import annotations
import argparse
import shlex
import subprocess
import sys
@@ -149,7 +150,7 @@ def main() -> int:
behind = rev_list(f"HEAD..{ref}")
if not behind:
print(f"Up to date with `{ref}`. Nothing to review. :white_check_mark:")
_print_crossref(ref)
_print_crossref(args.remote, args.branch)
return 0
fork_only = rev_list(f"{ref}..HEAD")
@@ -235,15 +236,15 @@ def main() -> int:
lines.append("_None._")
print("\n".join(lines))
_print_crossref(ref)
_print_crossref(args.remote, args.branch)
return 0
def _print_crossref(ref: str) -> None:
def _print_crossref(remote: str, branch: str) -> None:
print()
print(
"_For personalized-file version stamps (which methodology files changed), "
f"run `python tools/check_upstream_updates.py --remote {ref.split('/')[0]}`._"
f"run `python tools/check_upstream_updates.py --remote {shlex.quote(remote)} --branch {shlex.quote(branch)}`._"
)