Commits
For commit hashes, use of monospace is preferred because that makes the
width of commit hash consistent. "Commits for" in log page can be a
commit hash but I kept it as-is because most people would browse on branches.
"system-ui" is for UI texts, not for content texts.
From now on, controls and labels use system-ui and content texts use
--font-content (sans-serif).
Regression introduced at somewhere.
https://tangled.org/pocka.jp/legit/issues/12
https://tangled.org/pocka.jp/legit/issues/11
Rendering all commits in a repo is not a good idea.
It's really slow and heavy on an active repository such as Zig the
language.
https://tangled.org/pocka.jp/legit/issues/9
https://tangled.org/pocka.jp/legit/issues/7#comment-3mqn5xujwoh22
The summary page displays recent up to three commits, but underlying
logic reads the whole repo history then subslice the result. The loading
of entire commit history is really demanding task and slows the response
time of a summary page down a lot.
Before this patch, loading a summary page of Zig project took 900ms ~
1100ms. After this patch, it's 180ms under load.
README and preview code uses each own rendering logic, caused diverged
output. An internal directory link inside preview HTML links to 404
(server returns 500) page.
This patch refactors HTML rendering into interface-d one and let both
endpoint use that. The original motivation for this refactor was to
cache rendered HTML, but turns out refactor alone is significant so I
gave this a dedicated commit.
https://tangled.org/pocka.jp/legit/issues/5
Compiling HTML templates on every request is useless on production
deployment and slows down response time significantly.
This patch makes compile-on-request opt-in and upfront compilation a
default.
On my dev machine (Intel Core Ultra 9 285H), spam_repo_list 1,000
iterations / 30 VUs gets 6ms avg -> sub 1ms avg and spam_repo_summary
1,000 iterations / 30 VUs gets 8.2ms avg -> 2.5ms avg improvements.
Both templates dir and static dir are now optional.
I'm not sure empty paths will trigger error, though.
https://tangled.org/pocka.jp/legit/issues/6
https://github.com/icyphox/legit/pull/58
I could not write a test reliably triggers this condition (upload-pack
request having gzip body) even with system git.
https://tangled.org/pocka.jp/legit/issues/2
https://github.com/icyphox/legit/issues/56
There were no guard / check for "ignored" config in endpoints git client
uses, so everybody could clone ignored repositories.
For testing. Child packages cannot access embedded resources.
https://tangled.org/pocka.jp/legit/issues/3
https://github.com/icyphox/legit/issues/10
Deployment & distribution convenience.
https://tangled.org/pocka.jp/legit/issues/3
Having to copy the "static/" directories is PITA, and distribution
burden.
https://tangled.org/pocka.jp/legit/issues/4
bluemonday's documentation says the policy creation/editing is not safe
to use in multiple goroutines. Now only one policy exists in the entire
application and no creation/editing is happening inside HTTP server's
goroutine.
This also brings performance improvements. On my machine, spamming repo
summary page took 10ms~11ms med (avg), but with this patch they are now
7ms~8ms med (avg).
k6 run --vus 30 --iterations 1000 ./tests/k6/spam_repo_summary.js
Thank Anthony Wang for sending the original patch that brought this
topic in.
To prevent unnecessary rebuilds. Changes to README should not issue a
new build.
Nix outputs warning message when **user** calls "lib.getExe" on this
package.
---
evaluation warning: getExe: Package legit does not have the meta.mainProgram
attribute. We'll assume that the main program has the same name for now, but
this behavior is deprecated, because it leads to surprising errors when the
assumption does not hold. If the package has a main program, please set
`meta.mainProgram` in its definition to make this warning go away. Otherwise,
if the package does not have a main program, or if you don't control its
definition, use getExe' to specify the name to the program, such as
lib.getExe' foo "bar".
It's minimal, but useful for future additions.
Considering the current trend of malcious crawlers, I believe this is
necessary.
"defaultPackage" is deprecated.
This is handy for development inside a container / VM.
The motivation is to display "Powered by ...". The patch I received adds
that text to header, and I felt it stands out too much considering
frequency of user using (reading and getting actually useful
information from) it. I like the idea of "Powered by" as there were
times that text helped me discover new tools.
The most natural place to put it is footer, but my legit fork does not
have that. And just having "Powered by ..." text alone feels off, so I
added admin configurable links section for things like contact email
address, mirrors, and other social links.
I personally like the outcome.
The info log is completely useless, as it's repo owner's fault for not
having README, instead of site admin's. I configured this in the
template so users (site admins) can customize their own view.
A query component in URL does not have to be "key=value". In fact,
browsers interpret that as a URLSearchParams, a list of "key" or
"key=value" allowing a same key appearing multiple times. You don't have
to set "true" or "false": simply set the key or remove the one.
Co-authored-by: Anthony Wang <a@unnamed.website>
To stop requiring devs to install gopls globally.
The original patch also contains support for image display in READMEs.
I (committer) removed the latter for brevity and revert-ability.
This is critical for displaying images in README files.
There was no way to call dprint (except "nix-shell" and global mutation)
That makes unpleasant UX, such as almost-full scrollbars and requiring
two-fingers swipe twice (one for scroll `<pre>` and second for the page)
While Markdown is relatively readable format, syntax highlighted
monospace font is not easy to read compared to well-spaced sans-serif.
I don't know why, but it was uncomfortable to read texts at the very
near the top of a content area.
Everytime I see datetime text with time zone I'm not familiar with, I
struggle to calculate from my local time zone. There are situations
where author's/committer's local time zone matters, (e.g. did they write
this patch in night?) I kept the original datetime in "title" attribute
(tooltip). Browsers' handling of "title" attribute is bad, but it's
better than nothing.
When a file's line count exceeds certain amount (probably 130 or so?)
the line number rows slightly increases its vertical size and causes
misalign to a text line on its right.
This happens on Samsung Galaxy Tab S9 FE (Android 14), and does not
happen on Motorola Razr 40 Ultra (Android 15).
I still don't know which factor plays, but this patch fixes the bug.
I was surprised during writing "demo/config.yaml".
Since replacing templates, syntax highlighting no longer uses supplied
style.
This is handy. I'm not sure I'll create a reference doc for
configurations.
README may have tab character (e.g. code sample)
I'm going to make tab width user selectable. This is both as a temporary
solution and as a default value.
https://tangled.org/pocka.jp/legit/issues/7#comment-3mqn5xujwoh22
The summary page displays recent up to three commits, but underlying
logic reads the whole repo history then subslice the result. The loading
of entire commit history is really demanding task and slows the response
time of a summary page down a lot.
Before this patch, loading a summary page of Zig project took 900ms ~
1100ms. After this patch, it's 180ms under load.
README and preview code uses each own rendering logic, caused diverged
output. An internal directory link inside preview HTML links to 404
(server returns 500) page.
This patch refactors HTML rendering into interface-d one and let both
endpoint use that. The original motivation for this refactor was to
cache rendered HTML, but turns out refactor alone is significant so I
gave this a dedicated commit.
https://tangled.org/pocka.jp/legit/issues/5
Compiling HTML templates on every request is useless on production
deployment and slows down response time significantly.
This patch makes compile-on-request opt-in and upfront compilation a
default.
On my dev machine (Intel Core Ultra 9 285H), spam_repo_list 1,000
iterations / 30 VUs gets 6ms avg -> sub 1ms avg and spam_repo_summary
1,000 iterations / 30 VUs gets 8.2ms avg -> 2.5ms avg improvements.
https://tangled.org/pocka.jp/legit/issues/4
bluemonday's documentation says the policy creation/editing is not safe
to use in multiple goroutines. Now only one policy exists in the entire
application and no creation/editing is happening inside HTTP server's
goroutine.
This also brings performance improvements. On my machine, spamming repo
summary page took 10ms~11ms med (avg), but with this patch they are now
7ms~8ms med (avg).
k6 run --vus 30 --iterations 1000 ./tests/k6/spam_repo_summary.js
Thank Anthony Wang for sending the original patch that brought this
topic in.
Nix outputs warning message when **user** calls "lib.getExe" on this
package.
---
evaluation warning: getExe: Package legit does not have the meta.mainProgram
attribute. We'll assume that the main program has the same name for now, but
this behavior is deprecated, because it leads to surprising errors when the
assumption does not hold. If the package has a main program, please set
`meta.mainProgram` in its definition to make this warning go away. Otherwise,
if the package does not have a main program, or if you don't control its
definition, use getExe' to specify the name to the program, such as
lib.getExe' foo "bar".
The motivation is to display "Powered by ...". The patch I received adds
that text to header, and I felt it stands out too much considering
frequency of user using (reading and getting actually useful
information from) it. I like the idea of "Powered by" as there were
times that text helped me discover new tools.
The most natural place to put it is footer, but my legit fork does not
have that. And just having "Powered by ..." text alone feels off, so I
added admin configurable links section for things like contact email
address, mirrors, and other social links.
I personally like the outcome.
Everytime I see datetime text with time zone I'm not familiar with, I
struggle to calculate from my local time zone. There are situations
where author's/committer's local time zone matters, (e.g. did they write
this patch in night?) I kept the original datetime in "title" attribute
(tooltip). Browsers' handling of "title" attribute is bad, but it's
better than nothing.
When a file's line count exceeds certain amount (probably 130 or so?)
the line number rows slightly increases its vertical size and causes
misalign to a text line on its right.
This happens on Samsung Galaxy Tab S9 FE (Android 14), and does not
happen on Motorola Razr 40 Ultra (Android 15).
I still don't know which factor plays, but this patch fixes the bug.