From: john at keeping.me.uk (John Keeping)
Subject: Commit _subject_ filter, everywhere
Date: Sat, 2 Dec 2017 17:10:05 +0000 [thread overview]
Message-ID: <20171202171005.GE2379@john.keeping.me.uk> (raw)
In-Reply-To: <CAEYzJUECPr5pae0khboKZWYXPU10z9OYcPFMwcKQo-nLUQG4sw@mail.gmail.com>
On Sat, Dec 02, 2017 at 03:44:15PM +0100, Bjjjrn Forsman wrote:
> On 2 December 2017 at 13:49, John Keeping <john at keeping.me.uk> wrote:
> > After I wrote that I realised that for the existing commit-filter we
> > escape the content before writing to the filter. So it might be
> > reasonable to pass the whole <a></a> tag through the filter.
> >
> > That would make it easy for the filter to put extra content either
> > before or after the commit subject. It also makes the filter
> > integration much simpler, for example in ui-log.c:
> >
> > -- >8 --
> > diff --git a/ui-log.c b/ui-log.c
> > index 2d2bb31..f2a7852 100644
> > --- a/ui-log.c
> > +++ b/ui-log.c
> > @@ -234,8 +234,11 @@ static void print_commit(struct commit *commit, struct rev_info *revs)
> > strcpy(info->subject + i, wrap_symbol);
> > }
> > }
> > + cgit_open_filter(ctx.repo->subject_filter,
> > + oid_to_hex(&commit->object.oid));
> > cgit_commit_link(info->subject, NULL, NULL, ctx.qry.head,
> > oid_to_hex(&commit->object.oid), ctx.qry.vpath);
> > + cgit_close_filter(ctx.repo->subject_filter);
> > show_commit_decorations(commit);
> > html("</td><td>");
> > cgit_open_filter(ctx.repo->email_filter, info->author_email, "log");
> > -- 8< --
>
> I applied that patch, with s/subject_filter/commit_filter/, and
> updated my commit-filter to output a small SVG (borrowed from
> https://shields.io/) in front of the commit message.
>
> Here is the result:
>
> https://bforsman.name/cgit/nixos-config/log/
>
> I think it's looking good!
>
> On small annoyance though is that the CI status element, when loaded,
> causes the commit messages to move sideways. Ideally, the CI status
> (or whatever the user chose to attach to the commit) would not cause
> the layout to move (unless it's very big). I guess that's a
> conflicting goal between having a "commit prefix" and a dedicated
> column for this extra info. Another alternative is _appending_ the
> element, which a filter program has the ability to do. Then the layout
> would be stable, but the CI status elements would not align nicely in
> a column anymore. Hmm... :-)
I wonder if it would look better with a smaller symbol, like the
Libravatar icons for the author names here:
https://git.zx2c4.com/cgit/log/
Maybe something like the small tick/cross icons GitHub and GitLab use
for build status, for example:
https://github.com/rust-lang/rust/branches/all
https://gitlab.com/gitlab-org/gitlab-ce/commits/master
next prev parent reply other threads:[~2017-12-02 17:10 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-11-29 21:10
2017-12-02 11:31 ` john
2017-12-02 12:33 `
2017-12-02 12:49 ` john
2017-12-02 14:44 `
2017-12-02 17:10 ` john [this message]
2017-12-02 17:14 `
2017-12-02 19:00 `
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=20171202171005.GE2379@john.keeping.me.uk \
--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).