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>
このコミットが含まれているのは:
Christian Hesse 2018-06-05 12:46:13 +02:00 committed by Jason A. Donenfeld
コミット 0bb34ef130
2個のファイルの変更13行の追加1行の削除

ファイルの表示

@ -685,6 +685,14 @@ div#cgit a.tag-deco {
border: solid 1px #777700; 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 { div#cgit a.remote-deco {
color: #000; color: #000;
margin: 0px 0.5em; margin: 0px 0.5em;

ファイルの表示

@ -65,6 +65,8 @@ void show_commit_decorations(struct commit *commit)
return; return;
html("<span class='decoration'>"); html("<span class='decoration'>");
while (deco) { while (deco) {
struct object_id peeled;
int is_annotated = 0;
strncpy(buf, prettify_refname(deco->name), sizeof(buf) - 1); strncpy(buf, prettify_refname(deco->name), sizeof(buf) - 1);
switch(deco->type) { switch(deco->type) {
case DECORATION_NONE: case DECORATION_NONE:
@ -77,7 +79,9 @@ void show_commit_decorations(struct commit *commit)
ctx.qry.showmsg, 0); ctx.qry.showmsg, 0);
break; break;
case DECORATION_REF_TAG: 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; break;
case DECORATION_REF_REMOTE: case DECORATION_REF_REMOTE:
if (!ctx.repo->enable_remote_branches) if (!ctx.repo->enable_remote_branches)