~fkfd/git.gmi

28c21f08f02cd5d14c1e39150f748f94f945bd70 — Frederick Yin 1 year, 3 months ago 7f6773e
Show recent commits in summary
1 files changed, 9 insertions(+), 0 deletions(-)

M git-gmi/git.py
M git-gmi/git.py => git-gmi/git.py +9 -0
@@ 34,6 34,15 @@ class GitGmiRepo:

    def view_summary(self) -> str:
        response = f"{STATUS_SUCCESS} {META_GEMINI}\n" + self.generate_header()
        # show 3 recent commits
        recent_commits = self.get_commit_log()[:3]
        for cmt in recent_commits:
            time = str(datetime.utcfromtimestamp(cmt["time"])) + " UTC"
            response += (
                f"### {cmt['short_id']} - {cmt['author']} - {time}\n"
                f"{cmt['msg'].splitlines()[0]}\n\n"
            )  # TODO: link to commit view
        # find and display readme(.*)
        tree = self.get_tree(MAIN_BRANCH)
        trls = self.list_tree(tree)
        found_readme = False