Customization of log view

John Keeping john at
Mon May 1 11:45:16 CEST 2017

Hi Simon,

On Sun, Apr 30, 2017 at 02:20:05PM +0000, Simon Steinbeiss wrote:
> I couldn't find any information on this, so excuse me if you've heard this
> question (or: request?) a gazillion times before.
> We've been using cgit for Xfce for many years and we're really happy about
> it. Recently we set up hooks to add references to related commits to
> bugreports in our bugzilla instance. We also managed to make the bug
> references in cgit's commit view hyperlinks to bugzilla, so those two parts
> of our toolchain are more connected.
> What would be a nice extra is having clickable bug links in the log view,
> but I couldn't find any reference that that is currently possible. So first
> of all: is it possible to customize the log view so that we can either make
> the bug references clickable hyperlinks (appearance-wise similar to the
> branch and tag references) directly or e.g. add a new column with the
> buglinks?
> And if it currently isn't possible, is this a feature/option you would also
> be interested in supporting?
> Finally I'm grateful about any pointers as to how to get going in that
> direction!

There's no functionality like this at the moment.  It looks like you're
putting bug references in the subject, so presumably adding a filter
around the subject in ui-log.c is what you're looking for.

We currently pass the subject through the commit filter for the commit
UI, so I guess that could be reued for the log view.

The problem is that in the log UI the subject is a hyperlink but all
our current filters act on plain text.  I guess you could pull apart
cgit_commit_link() to allow opening the <a> tag as a separate step and
have the caller output the body of that tag, which could be passed
through a filter.  But I haven't thought through all of the edge cases
here - what if the filter wants its own hyperlink, like your bug link?
Would it be better to call the filter with the href as an argument, so
it's up to the filter to output the anchor tag around the subject?


More information about the CGit mailing list