]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
script/ptl-tool: source githubmap only when producing credits 69465/head
authorPatrick Donnelly <pdonnell@ibm.com>
Fri, 29 May 2026 14:40:45 +0000 (10:40 -0400)
committerPatrick Donnelly <pdonnell@ibm.com>
Mon, 15 Jun 2026 20:27:22 +0000 (16:27 -0400)
Assisted-by: Gemini
Signed-off-by: Patrick Donnelly <pdonnell@ibm.com>
src/script/ptl-tool.py

index 762069ca3b5f90c54c62ef10ea3360a470c84354..a2d9d781db14ad6159b6f527563eac0938089d31 100755 (executable)
@@ -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: