Commit _subject_ filter, everywhere
john at keeping.me.uk
Sat Dec 2 12:31:24 CET 2017
On Wed, Nov 29, 2017 at 10:10:00PM +0100, Bjjjrn Forsman wrote:
> I got this idea to generate a link to the CI server job in front of
> each commit message subject. Think small green/red boxes that are
> clickable. I figure that getting the build status directly in cgit is
> much more efficient than navigating the CI server itself, which
> typically requires many clicks to find the build that comes out of a
> given commit.
> I had high hopes for the the commit-filter= setting, but found that
> * commit-filter= is only run when showing a full commit, not other
> places. I.e. it is applied when showing the "commit" tab, but not on
> "summary", "logs" or "refs".
> * commit-filter= is run twice on a commit message. Once for the
> subject and once for the body. I expected only once. (Is this a bug?)
> Any thoughts on if/how this use case can be supported? A separate
> filter? Or simply run commit-filter= everywhere (breaking change)?
I was going to suggest introducing a new subject-filter which is used to
filter the commit subject wherever it is displayed, but there is a
subtlety which makes this more complicated in the summary, log and refs
pages than it is in the commit page.
When we are showing a single-line summary of a commit, the subject is a
hyperlink so adding new content outside the existing subject is not
possible with the obvious filter implementation.
One option would be to push the <a></a> tag generation down into the
filter, but I'd rather avoid that if possible.
What do you think about adding a "filter" which is called before the
commit subject is printed and allows outputting additional HTML content?
("filter" is in quotes since there will not be any content copied
through the program.)
More information about the CGit