From 998c1777afeeb44ecf6ba2e735a4d6176a9b339e Mon Sep 17 00:00:00 2001 From: "Gabriel A. Giovanini" Date: Sat, 15 Feb 2025 21:18:06 +0100 Subject: feat: Add tag and branch to log Now it is possible to see tag and branch on the log page. --- templates/commit.qtpl | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) (limited to 'templates/commit.qtpl') diff --git a/templates/commit.qtpl b/templates/commit.qtpl index b5699f4..adc6f2a 100644 --- a/templates/commit.qtpl +++ b/templates/commit.qtpl @@ -1,24 +1,34 @@ +{% import "git.gabrielgio.me/cerrado/pkg/git" %} {% import "git.gabrielgio.me/cerrado/pkg/humanize" %} -{% import "github.com/go-git/go-git/v5/plumbing/object" %} -{% func Commit(name string, c *object.Commit, showTar bool) %} +{% func Commit(name string, c *git.CommitReference, showTar bool) %}
- {%s c.Hash.String()[0:8] %} — - {%s c.Author.Name %} + {%s c.Commit().Hash.String()[0:8] %} — + {%s c.Commit().Author.Name %} + — + {% if c.HasReference() %} + {% for _, r := range c.References() %} + {% if r.Name().IsBranch() %} + {%s r.Name().Short() %} + {% else %} + {%s r.Name().Short() %} + {% endif %} + {% endfor %} + {%endif%}
{% if showTar %} {% endif %}
-
{%s c.Message %}
+
{%s c.Commit().Message %}
{% endfunc %} -- cgit v1.2.3