diff options
author | Christian Hesse | 2018-06-05 12:46:13 +0200 |
---|---|---|
committer | Jason A. Donenfeld | 2018-06-27 18:01:29 +0200 |
commit | 0bb34ef130f05b865ee2a34d196ea6352590f673 (patch) | |
tree | a3e3246b933af347dc8c4fef52db31df3db44d84 | |
parent | print git version string in footer (diff) | |
download | cgit-0bb34ef130f05b865ee2a34d196ea6352590f673.tar.gz cgit-0bb34ef130f05b865ee2a34d196ea6352590f673.zip |
ui-log: highlight annotated tags in different color
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>
-rw-r--r-- | cgit.css | 8 | ||||
-rw-r--r-- | ui-log.c | 6 |
2 files changed, 13 insertions, 1 deletions
diff --git a/cgit.css b/cgit.css index 217a05a..05c4530 100644 --- a/cgit.css +++ b/cgit.css | |||
@@ -685,6 +685,14 @@ div#cgit a.tag-deco { | |||
685 | border: solid 1px #777700; | 685 | border: solid 1px #777700; |
686 | } | 686 | } |
687 | 687 | ||
688 | div#cgit a.tag-annotated-deco { | ||
689 | color: #000; | ||
690 | margin: 0px 0.5em; | ||
691 | padding: 0px 0.25em; | ||
692 | background-color: #ffcc88; | ||
693 | border: solid 1px #777700; | ||
694 | } | ||
695 | |||
688 | div#cgit a.remote-deco { | 696 | div#cgit a.remote-deco { |
689 | color: #000; | 697 | color: #000; |
690 | margin: 0px 0.5em; | 698 | margin: 0px 0.5em; |
diff --git a/ui-log.c b/ui-log.c index 8e36fba..b5cd2f6 100644 --- a/ui-log.c +++ b/ui-log.c | |||
@@ -65,6 +65,8 @@ void show_commit_decorations(struct commit *commit) | |||
65 | return; | 65 | return; |
66 | html("<span class='decoration'>"); | 66 | html("<span class='decoration'>"); |
67 | while (deco) { | 67 | while (deco) { |
68 | struct object_id peeled; | ||
69 | int is_annotated = 0; | ||
68 | strncpy(buf, prettify_refname(deco->name), sizeof(buf) - 1); | 70 | strncpy(buf, prettify_refname(deco->name), sizeof(buf) - 1); |
69 | switch(deco->type) { | 71 | switch(deco->type) { |
70 | case DECORATION_NONE: | 72 | case DECORATION_NONE: |
@@ -77,7 +79,9 @@ void show_commit_decorations(struct commit *commit) | |||
77 | ctx.qry.showmsg, 0); | 79 | ctx.qry.showmsg, 0); |
78 | break; | 80 | break; |
79 | case DECORATION_REF_TAG: | 81 | case DECORATION_REF_TAG: |
80 | cgit_tag_link(buf, NULL, "tag-deco", buf); | 82 | if (!peel_ref(deco->name, &peeled)) |
83 | is_annotated = !oidcmp(&commit->object.oid, &peeled); | ||
84 | cgit_tag_link(buf, NULL, is_annotated ? "tag-annotated-deco" : "tag-deco", buf); | ||
81 | break; | 85 | break; |
82 | case DECORATION_REF_REMOTE: | 86 | case DECORATION_REF_REMOTE: |
83 | if (!ctx.repo->enable_remote_branches) | 87 | if (!ctx.repo->enable_remote_branches) |