Commit graph

24 commits

Author SHA1 Message Date
Vincent Ambo
8361b82d0a refactor(third_party): Consistent use of depot.third_party vs. pkgs
In preparation for the solution of b/108, we need to consistently use
`depot.third_party` for packages that are only packed in the TVL depot
and `pkgs` for things that come from nixpkgs.

This commit cleans up a huge chunk of these uses in //third_party

Change-Id: Ic382c0cdea7330a84d5f0b7d109c824ddceb94e7
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2912
Tested-by: BuildkiteCI
Reviewed-by: sterni <sternenseemann@systemli.org>
2021-04-10 11:48:55 +00:00
sterni
c28d9710d6 fix(3p/cgit): fix max-width for #summary
Having a space between the number and the unit is not valid CSS.
I was aware of this problem, but apparently forgot to amend the fix.

Change-Id: I74936db515799763038669d0a11da53f28f722be
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2867
Tested-by: BuildkiteCI
Reviewed-by: lukegb <lukegb@tvl.fyi>
2021-04-06 09:22:57 +00:00
sterni
db80c2d368 feat(3p/cgit): limit width of div#summary, i. e. /about/**
Decreased text width for the /about pages should increase readability
considerably as jumping back to the beginning is hard for longer
lines. The result is still not perfect as the font size for the /about
pages is rather small and many lines thus get broken somewhat awkwardly.

We could probably migitate that using a larger font size.

The implementation choice of adding a tvl-extra.css which we inject into
cgit.css in preBuild is for simplicity: We don't need to worry about
routing an extra CSS file and loading it from the right location via
extra cgit head entries and serving it at the correct location using
either nginx or thttpd.

A drawback of this is however that iteration is slowed down by cgit's
compilation time.

Additionally, this should be the basis for implementing a bubblegum
themed cgit for Profpatsch.

Change-Id: I18060f735167acd623cef7a17c83408978461249
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2756
Tested-by: BuildkiteCI
Reviewed-by: tazjin <mail@tazj.in>
2021-04-02 10:24:41 +00:00
sterni
1f40a52280 feat(3p/cgit): enableParallelBuilding
This gives a decent compilation speedup even on slow machines, so seems
worth it. Let's hope the cgit build process is not racy.

Change-Id: Ic4ae72789da2ccae16fd48e46aec624244b25035
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2755
Tested-by: BuildkiteCI
Reviewed-by: tazjin <mail@tazj.in>
2021-04-02 09:17:05 +00:00
Florian Klink
ab7e752b4a chore(third_party/cgit): use lib instead of stdenv.lib
Getting `lib` from `stdenv.lib` is deprecated, and throws warnings.

Change-Id: Ic925818c1b5a67d15d6d40ad784554328cd603e0
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2751
Reviewed-by: lukegb <lukegb@tvl.fyi>
Reviewed-by: glittershark <grfn@gws.fyi>
Reviewed-by: tazjin <mail@tazj.in>
Tested-by: BuildkiteCI
2021-04-01 17:30:20 +00:00
Vincent Ambo
cd652b3b22 fix(3p/cgit): Rename remaining 'sha1' references to 'oid'
This changed upstream & upstream-upstream, but was still used in our
patches.

Change-Id: Id33f868a4f188deb3348425276bc5b4c4b36aff9
2020-11-21 20:09:42 +01:00
Vincent Ambo
1e81ce6622 merge(3p/cgit): subtree merge at adcc4f82
Change-Id: I16941629a17a2f39b9324cb85dc0cec6b104dfe4
2020-11-21 20:09:33 +01:00
Alyssa Ross
6b181d314f fix(3p/cgit): transpose html_option parameters
I got these the wrong way round, fixed them in the patch in my Nix
configuration, and then neglected to fix them in the version for
depot.

Fixes: be98295dc2
Change-Id: Ib7d4e433887f474ae9675e9948ab38f640181095
Reviewed-on: https://cl.tvl.fyi/c/depot/+/1383
Reviewed-by: tazjin <mail@tazj.in>
Reviewed-by: kanepyork <rikingcoding@gmail.com>
Tested-by: BuildkiteCI
2020-08-03 10:28:44 +00:00
Alyssa Ross
be98295dc2 feat(3p/cgit): add "this commit" option to switch form
Branches are grouped into their own section to make the "this commit"
option visually distinct.

Adding this option will result in two options being marked as selected
if a branch has the same name as a commit oid.  But that would cause
all sorts of other problems anyway (attempting to switch to the branch
would actually give you the commit, etc.), so let's not worry about
that.

A "permalink" link on the blob view next to the "plain" link would
probably be more discoverable, but that would only work for the blob
view.  The switch UI is visible everywhere.

This patch is in use already at <https://git.qyliss.net/> and
<https://spectrum-os.org/git/>.

Signed-off-by: Alyssa Ross <hi@alyssa.is>
Message-Id: <20200723204820.16776-1-hi@alyssa.is>
Cc: Profpatsch <mail@profpatsch.de>
Change-Id: I7e88d1231dd402e0ad764e16b28e9a51964c6293
Reviewed-on: https://cl.tvl.fyi/c/depot/+/1382
Tested-by: BuildkiteCI
Reviewed-by: tazjin <mail@tazj.in>
2020-07-23 20:53:04 +00:00
Luke Granger-Brown
54b9925b93 fix(3p/cgit): Fix compilation under Clang
Clang treats function-like macros "correctly", in that, per the C11 spec:
"Each subsequent instance of the function-like macro name followed by a (
[...] is replaced by the replacement list [...]".

Additionally, fprintf is also permitted to be defined as a function-like
macro rather than as a true function: "Any function declared in a header
may be additionally implemented as a function-like macro defined in the
header [...]". The specification then suggests surrounding the name of the
function in parens to avoid this, which is the technique we use here to avoid
the function-like macro being invoked.

The other fix here is to use uintptr_t for some arithmetic, since Git
is expecting an int as the value here and not a pointer.
2020-06-03 02:24:00 +01:00
Vincent Ambo
f1136cde16 fix(third_party/cgit): Correctly make "about links" on about page 2020-04-19 19:25:43 +00:00
C. McEnroe
cd8a9f7b27 feat(cgit/ui-commit): show subject in page title 2020-02-21 21:03:03 +00:00
C. McEnroe
b503c2afcf feat(cgit/ui-tree): show symlink targets in tree listing
Add links to symbolic link targets in tree listings, formatted like
"ls -l".  Path normalization collapses any ".." components of the link.
2020-02-21 21:03:01 +00:00
C. McEnroe
6932c431bb feat(cgit/ui-tree): don't link to blame for binary blobs 2020-02-21 21:02:57 +00:00
C. McEnroe
37b0b37771 feat(cgit/ui-blame): bail if blob is binary
This avoids piping binary blobs through the source-filter.
2020-02-21 21:02:46 +00:00
Vincent Ambo
4bbbb58cb5 chore: Rename pkgs->depot in all Nix file headers 2020-02-21 13:54:53 +00:00
Vincent Ambo
e70b88b3c2 fix(third_party/cgit): Make vpath & repo available for about cmd
This change makes cgit pass the current repo and vpath inside of the
repo on to the about cmd, which makes it possible for it to correctly
render `tree`, `log` and other links to the same vpath.
2020-02-09 17:01:21 +00:00
Vincent Ambo
c9923c5abb chore(third_party/cgit): Remove git submodule
This is instead passed in by Nix, and it confuses git on clones.
2020-01-18 11:33:07 +00:00
Vincent Ambo
c2a797ed8b feat(third_party/cgit): Render timestamps in dottime
Using the DATE_DOTTIME format support in git.
2020-01-12 03:12:34 +00:00
Vincent Ambo
ac6485efeb feat(third_party/cgit): Add derivation to build cgit
This is pretty much exactly the derivation from nixpkgs, with some
things removed to reduce the closure size (e.g. the various formatters
used in the default cgit version, which are replaced by cheddar in my
setup).
2020-01-12 02:49:44 +00:00
Vincent Ambo
be2f51e1dd feat(third_party/cgit): Generate links to about pages from subtrees
If you're on tree/foo/bar, the about link will now point to
about/foo/bar.

Currently the annoying thing about this is that it will also do it for
files.
2020-01-11 23:47:41 +00:00
Vincent Ambo
0294eec9da feat(third_party/cgit): Use README at each subtree
This means that individual subtrees of a repository will also have
their READMEs rendered on the about page, for example:

    /foo/bar/README.md

Will render on:

    /about/foo/bar/

This is useful for monorepo setups in which subtrees represent
individual projects.
2020-01-11 23:47:39 +00:00
Vincent Ambo
8de22f654c feat(third_party/cgit): Generate monorepo compatible URLs
Generates URLs that do not include the repository name.

On git.tazj.in, only one repository (depot) is served - hence URLs
generated by cgit need not include the name.
2020-01-11 23:47:36 +00:00
Vincent Ambo
5a069d5888 merge(third_party/cgit): Import at master of 2020-01-11
Imported commit '723dc8fbcb1a4609c264758eae420ee2811a2b55' as
'third_party/cgit'.
2020-01-11 23:31:05 +00:00