From: Patrick Donnelly Date: Fri, 29 May 2026 14:40:45 +0000 (-0400) Subject: script/ptl-tool: source githubmap only when producing credits X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=88b9725be03dcd9267f8ab224dfd68be73631810;p=ceph.git script/ptl-tool: source githubmap only when producing credits Assisted-by: Gemini Signed-off-by: Patrick Donnelly --- diff --git a/src/script/ptl-tool.py b/src/script/ptl-tool.py index 762069ca3b5..a2d9d781db1 100755 --- a/src/script/ptl-tool.py +++ b/src/script/ptl-tool.py @@ -1675,20 +1675,6 @@ def build_branch(args): G = git.Repo(args.git) - try: - c = resolve_ref(G, 'main', BASE_REMOTE_URL, args.always_fetch) - githubmap_content = G.git.show(f"{c.hexsha}:.githubmap") - comment = re.compile(r"\s*#") - patt = re.compile(r"([\w-]+)\s+(.*)") - for line in githubmap_content.splitlines(): - if comment.match(line): - continue - m = patt.match(line) - if m: - CONTRIBUTORS[m.group(1)] = m.group(2) - except git.exc.GitCommandError as e: - raise SystemExit(f"Could not fetch .githubmap from {BASE_REMOTE_URL}:main:\n{e}") - R = None if args.create_qa or args.update_qa or args.audit or args.final_merge: log.info("connecting to %s", REDMINE_ENDPOINT) @@ -1739,6 +1725,21 @@ def build_branch(args): args.always_fetch = True args.skip_conflict_check = True + if args.credits: + try: + c = resolve_ref(G, 'main', BASE_REMOTE_URL, args.always_fetch) + githubmap_content = G.git.show(f"{c.hexsha}:.githubmap") + comment = re.compile(r"\s*#") + patt = re.compile(r"([\w-]+)\s+(.*)") + for line in githubmap_content.splitlines(): + if comment.match(line): + continue + m = patt.match(line) + if m: + CONTRIBUTORS[m.group(1)] = m.group(2) + except git.exc.GitCommandError as e: + raise SystemExit(f"Could not fetch .githubmap from {BASE_REMOTE_URL}:main:\n{e}") + # Compute branch names now that integration flags and auto-detect have settled branch = datetime.datetime.utcnow().strftime(args.branch).format(user=USER) if args.branch_release: