]> git.cameronkatri.com Git - cgit.git/commitdiff
ui-log: highlight annotated tags in different color
authorChristian Hesse <mail@eworm.de>
Tue, 5 Jun 2018 10:46:13 +0000 (12:46 +0200)
committerJason A. Donenfeld <Jason@zx2c4.com>
Wed, 27 Jun 2018 16:01:29 +0000 (18:01 +0200)
Annotated tags have some extra information... Descriptive text or signature.
Highlighting annotated tags in a different color show what tag may be worth
clicking for extra information.

Signed-off-by: Christian Hesse <mail@eworm.de>
Reviewed-by: John Keeping <john@keeping.me.uk>
cgit.css
ui-log.c

index 217a05a557d7d806006946810efbdb47437d37bb..05c4530bab8e21d4942bd1c1f73ea6f79690b635 100644 (file)
--- a/cgit.css
+++ b/cgit.css
@@ -685,6 +685,14 @@ div#cgit a.tag-deco {
        border: solid 1px #777700;
 }
 
+div#cgit a.tag-annotated-deco {
+       color: #000;
+       margin: 0px 0.5em;
+       padding: 0px 0.25em;
+       background-color: #ffcc88;
+       border: solid 1px #777700;
+}
+
 div#cgit a.remote-deco {
        color: #000;
        margin: 0px 0.5em;
index 8e36fba9f811c13fb90ec9879f26bf3a4b33800e..b5cd2f61d3305f15f4201e8faa4bca1b93b4864c 100644 (file)
--- a/ui-log.c
+++ b/ui-log.c
@@ -65,6 +65,8 @@ void show_commit_decorations(struct commit *commit)
                return;
        html("<span class='decoration'>");
        while (deco) {
+               struct object_id peeled;
+               int is_annotated = 0;
                strncpy(buf, prettify_refname(deco->name), sizeof(buf) - 1);
                switch(deco->type) {
                case DECORATION_NONE:
@@ -77,7 +79,9 @@ void show_commit_decorations(struct commit *commit)
                                ctx.qry.showmsg, 0);
                        break;
                case DECORATION_REF_TAG:
-                       cgit_tag_link(buf, NULL, "tag-deco", buf);
+                       if (!peel_ref(deco->name, &peeled))
+                               is_annotated = !oidcmp(&commit->object.oid, &peeled);
+                       cgit_tag_link(buf, NULL, is_annotated ? "tag-annotated-deco" : "tag-deco", buf);
                        break;
                case DECORATION_REF_REMOTE:
                        if (!ctx.repo->enable_remote_branches)