]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-build.git/commitdiff
ceph-pr-commits: simplify regex and git command
authorVille Ojamo <14869000+bluikko@users.noreply.github.com>
Fri, 12 Jun 2026 05:19:24 +0000 (12:19 +0700)
committerVille Ojamo <14869000+bluikko@users.noreply.github.com>
Fri, 12 Jun 2026 05:19:24 +0000 (12:19 +0700)
Use git command output formatting instead of a complex regex on the
standard git log output.

Signed-off-by: Ville Ojamo <git2233+ceph@ojamo.eu>
ceph-pr-commits/build/test_commits.py

index 4162ec7a41a3e9b02095194b28133fa6fa8f6bfe..3d2c62e7cc72216e5a0a927f743ea3fc5ab50b5a 100644 (file)
@@ -39,9 +39,8 @@ class TestCommits(object):
 
     @pytest.mark.doc_test
     def test_doc_title(self):
-        doc_regex = '\nDate:[^\n]+\n\n    doc'
-        all_commits = 'git log -z --no-merges origin/%s..%s' % (
-            self.target_branch, self.source_branch)
+        doc_regex = '^doc'
+        all_commits = f'git log -z --no-merges --pretty=format:%s origin/{self.target_branch}..{self.source_branch}'
         wrong_commits = list(filterfalse(
             re.compile(doc_regex).search,
             self.command(all_commits).split('\0')))