[Git][reproducible-builds/reproducible-website][master] misc improves to generate-draft

Chris Lamb (@lamby) gitlab at salsa.debian.org
Thu Oct 2 21:57:46 UTC 2025



Chris Lamb pushed to branch master at Reproducible Builds / reproducible-website


Commits:
7c426218 by Chris Lamb at 2025-10-02T14:49:10-07:00
misc improves to generate-draft

- - - - -


1 changed file:

- bin/generate-draft


Changes:

=====================================
bin/generate-draft
=====================================
@@ -46,9 +46,13 @@ def log(msg, *args, **kwargs):
 
 def sibling_repo_gitdir(path):
     toplevel = os.path.dirname(
-        subprocess.check_output(("git", "rev-parse", "--show-toplevel",)).decode(
-            "utf-8"
-        )
+        subprocess.check_output(
+            (
+                "git",
+                "rev-parse",
+                "--show-toplevel",
+            )
+        ).decode("utf-8")
     )
 
     return os.path.join(toplevel, path, ".git")
@@ -56,7 +60,11 @@ def sibling_repo_gitdir(path):
 
 def ensure_dir(path):
     if not os.path.isdir(path):
-        raise ValueError("not a directory: {}".format(path))
+        parent = os.path.dirname(path)
+        hint = "cd {} && git clone git at salsa.debian.org:reproducible-builds/{}".format(
+            os.path.dirname(parent), os.path.basename(parent)
+        )
+        raise ValueError(f"{path} not a directory. Try {hint}")
 
 
 def get_data(year, month, max_age=3600):
@@ -130,16 +138,25 @@ def get_authors(year, month):
     if len(authors) < 2:
         return " and ".join(authors)
 
-    return "{} and {}".format(", ".join(authors[:-1]), authors[-1],)
+    return "{} and {}".format(
+        ", ".join(authors[:-1]),
+        authors[-1],
+    )
 
 
 def get_ftbfs_bugs(month_start, month_end):
-    return bugs(month_start, month_end, "bugs_usertags.tag = '{}'".format("ftbfs"),)
+    return bugs(
+        month_start,
+        month_end,
+        "bugs_usertags.tag = '{}'".format("ftbfs"),
+    )
 
 
 def get_patches(month_start, month_end):
     return bugs(
-        month_start, month_end, "id IN (SELECT id FROM bugs_tags WHERE tag = 'patch')",
+        month_start,
+        month_end,
+        "id IN (SELECT id FROM bugs_tags WHERE tag = 'patch')",
     )
 
 
@@ -307,7 +324,7 @@ def commits(month_start, month_end, project, path="."):
     # Assume its in the parent dir
     git_dir = sibling_repo_gitdir(project)
 
-    #subprocess.check_call(("git", "fetch", "origin"), cwd=git_dir)
+    # subprocess.check_call(("git", "fetch", "origin"), cwd=git_dir)
 
     output = subprocess.check_output(
         (



View it on GitLab: https://salsa.debian.org/reproducible-builds/reproducible-website/-/commit/7c42621819a60e7043e1cda909ca1db0c1352670

-- 
View it on GitLab: https://salsa.debian.org/reproducible-builds/reproducible-website/-/commit/7c42621819a60e7043e1cda909ca1db0c1352670
You're receiving this email because of your account on salsa.debian.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.reproducible-builds.org/pipermail/rb-commits/attachments/20251002/71030c78/attachment.htm>


More information about the rb-commits mailing list