]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
script/ptl-tool: source githumap from main branch 68640/head
authorPatrick Donnelly <pdonnell@redhat.com>
Mon, 27 Apr 2026 20:08:56 +0000 (16:08 -0400)
committerPatrick Donnelly <pdonnell@redhat.com>
Wed, 29 Apr 2026 19:14:26 +0000 (12:14 -0700)
To make it authoritative.

Signed-off-by: Patrick Donnelly <pdonnell@redhat.com>
src/script/ptl-tool.py

index 4848190f12b5cb4861cbaddce6f0e170c2a1ac63..f729247402fd7b4c7dc483a9b128f4bef8319df0 100755 (executable)
@@ -237,14 +237,6 @@ while not os.path.exists(git_dir + '/.git'):
 
 CONTRIBUTORS = {}
 NEW_CONTRIBUTORS = {}
-with open(git_dir + "/.githubmap", mode='r', encoding='utf-8') as f:
-    comment = re.compile(r"\s*#")
-    patt = re.compile(r"([\w-]+)\s+(.*)")
-    for line in f:
-        if comment.match(line):
-            continue
-        m = patt.match(line)
-        CONTRIBUTORS[m.group(1)] = m.group(2)
 
 BZ_MATCH = re.compile("(.*https?://bugzilla.redhat.com/.*)")
 TRACKER_MATCH = re.compile("(.*https?://tracker.ceph.com/.*)")
@@ -363,6 +355,21 @@ def build_branch(args):
 
     G = git.Repo(args.git)
 
+    try:
+        log.info("Fetching .githubmap from %s main branch", BASE_REMOTE_URL)
+        G.git.fetch(BASE_REMOTE_URL, "main")
+        githubmap_content = G.git.show("FETCH_HEAD:.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}")
+
     if args.create_qa or args.update_qa:
         log.info("connecting to %s", REDMINE_ENDPOINT)
         R = Redmine(REDMINE_ENDPOINT, username=REDMINE_USER, key=REDMINE_API_KEY)