From mboxrd@z Thu Jan 1 00:00:00 1970 From: john at keeping.me.uk (John Keeping) Date: Tue, 5 Jun 2018 15:26:17 +0100 Subject: [PATCH v2 1/1] ui-log: highlight annotated tags in different color In-Reply-To: <20180605114013.18488-1-list@eworm.de> References: <20180605133755.7be5c2b1@leda> <20180605114013.18488-1-list@eworm.de> Message-ID: <20180605142617.GC1922@john.keeping.me.uk> On Tue, Jun 05, 2018 at 01:40:13PM +0200, Christian Hesse wrote: > From: Christian Hesse It would be nice to include the rationale from your previous message in the commit to it's easily accessible via git blame in the future. But I don't think that's absolutely necessary, so: Reviewed-by: John Keeping > Signed-off-by: Christian Hesse > --- > 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(""); > 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)