From: list at eworm.de (Christian Hesse)
Subject: [PATCH v2 1/1] ui-log: highlight annotated tags in different color
Date: Tue, 5 Jun 2018 13:40:13 +0200 [thread overview]
Message-ID: <20180605114013.18488-1-list@eworm.de> (raw)
In-Reply-To: <20180605133755.7be5c2b1@leda>
From: Christian Hesse <mail at eworm.de>
Signed-off-by: Christian Hesse <mail at eworm.de>
---
cgit.css | 8 ++++++++
ui-log.c | 6 +++++-
2 files changed, 13 insertions(+), 1 deletion(-)
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 {
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;
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)
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)
next prev parent reply other threads:[~2018-06-05 11:40 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-06-05 10:47 [PATCH " list
2018-06-05 11:03 ` john
2018-06-05 11:37 ` list
2018-06-05 11:40 ` list [this message]
2018-06-05 14:26 ` [PATCH v2 " john
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180605114013.18488-1-list@eworm.de \
--to=cgit@lists.zx2c4.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).