[PATCH v4 00/16] Render READMEs inline in tree view

Jason A. Donenfeld Jason at zx2c4.com
Wed Jun 27 19:18:57 CEST 2018


Hey Andy,

Thanks for this patchset. It looks like this is shaping up into a nice
direction. However, I'm a bit concerned about our nobs becoming
slightly overlapping and incoherent, and I think that with this
series, we should also unify how we handle rendering.

With the current state of this series, cgit would have the following options:

- render.<ext>
- inline-readme
- render-filter
- about-filter
- commit-filter
- source-filter
- owner-filter
- readme=file
- readme=:file

Whoa nelly. Of these, about-filter, commit-filter, source-filter, and
owner-filter all have analogs in the repo.* namespace, which makes
sense; it seems this was omitted from the render-filter introduced by
this series. The thing that unifies about-filter, commit-filter,
source-filter, and owner-filter is that they all modify some aspect of
the rendered output, either via fork/exec or via lua.

In adding readme files under the tree view, the obvious observation is
that this is pretty much the same type of rendering that we're doing
in about-filter.

In adding rendering of arbitrary files in blob view, this is
essentially a fancy source view, with the one caveat of our
interesting handling of line numbers.

So, I'd propose the following re-organization (and after we nail it
down, we can bikeshed about compatibility with old configs, but for
now let's focus on ideal design):

- We retain commit-filter, source-filter, and owner-filter as we have them now.
- We rename about-filter to readme-filter.
- We remove `readme` and instead introduce `readme-filename`, which
can be specified multiple times as is habit. This would simply take
the set of filenames considered to be readme files (readme.md,
readme.txt, etc). [Bikeshed discussion: case insensitive?]
- We introduce an options at the global level and at the .repo level
of `about-readme=/path/to/absolute/file` and `about-readme=<BRANCH>:`
and `about-readme=:`. The first would replace our original usage of
`readme=/path/to=file`, and the second would replace the use of
`readme=branch:whatever`, specifying an explicit branch (like
cgit.git's wiki branch), and the third would indicate the default
branch.
- We introduce an option at the global level and at the .repo level of
`tree-readme=1/0` to display (or not) the readme under each tree.
- We do not introduce render-filter. We do not introduce render.<ext>;
such extension selection is successfully handled by the various
filters themselves already.

John, Christian -- what are your thoughts on this?

Regards,
Jason


More information about the CGit mailing list