From f1457e8f8e59bfbc083ca7573e3e82058e22b303 Mon Sep 17 00:00:00 2001 From: Stephan Kulow Date: Sun, 6 Nov 2022 10:14:55 +0100 Subject: [PATCH] Move git commit message creation into class --- lib/db_revision.py | 4 ++++ lib/git_exporter.py | 3 +-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/db_revision.py b/lib/db_revision.py index 3ca5453..bc3d467 100644 --- a/lib/db_revision.py +++ b/lib/db_revision.py @@ -51,6 +51,10 @@ class DBRevision: return self.package < other.package return self.rev < other.rev + def git_commit_message(self): + # TODO: Normalize better the commit message + return f"{self.comment}\n\n{self}" + def as_dict(self): """Return a dict we can put into YAML for test cases""" ret = { diff --git a/lib/git_exporter.py b/lib/git_exporter.py index c13f5e4..d9c1748 100644 --- a/lib/git_exporter.py +++ b/lib/git_exporter.py @@ -144,8 +144,7 @@ class GitExporter: flat.user.realname, flat.user.email, flat.commit.commit_time, - # TODO: Normalize better the commit message - f"{flat.commit.comment}\n\n{flat.commit}", + flat.commit.git_commit_message(), parents=parents, ) flat.commit.git_commit = commit