legit

Fork of https://git.icyphox.sh/legit

Commits at 1a250e6fc60ab80f75cd5469e469dadacf72e271

  1. 1a250e6f Add "ui.diff.hideThresholdLines" option Rendering over 10,000 lines diff is tough for browsers. This option hides the element to ease layout calculation. This does not change the page load speed, though. Shota FUJI authored at Shota FUJI comitted at
  2. 74c5502f Add option to generated diff using system git go-diff is too slow. As legit parses the generated patch file, we can simply swap diff generator based on option. This is an opt-in config for backwards compatibility. The diff generated by git command is different (more intuitive hunk.) This is part of https://tangled.org/pocka.jp/legit/issues/25 Shota FUJI authored at Shota FUJI comitted at
  3. a430e231 Create internal cmd to test commit page regressions Shota FUJI authored at Shota FUJI comitted at
  4. 94dec475 Add load test for commit page with large diff The commit page is so slow on large-ish diffs. Shota FUJI authored at Shota FUJI comitted at
  5. cd6335e2 v1.1.0 Shota FUJI authored at Shota FUJI comitted at
  6. b6743137 Add trailing slash to always-307 redirecting links Links this patch touches require a trailing slash, and request without trailing slash will be 307 redirected to the one with a trailing slash. This patch eliminates those unnecessary roundtrip. Shota FUJI authored at Shota FUJI comitted at
  7. fa2cc136 Add staticDirRevision option / build flag Mainly for invalidating browser cache after upgrading legit. https://tangled.org/pocka.jp/legit/issues/22 Shota FUJI authored at Shota FUJI comitted at
  8. 1d9d7675 Fix 404/500 pages have broken style and are unhelpful https://tangled.org/pocka.jp/legit/issues/21 The initial plan was to just fix the broken style. As I editing the HTML, I started to think this is a great place to put bug report link. In the past, I put this kind of diagnosis info on an error page in my work and that greatly helped debugging issues. The info here is just a four-line text that is obvious in server log (if setup,) but end user attaching this in complaints or whatever is really helpful, trust me. UA is for grepping log lines. Even if it was generalized (for privacy reasons,) it's still useful and time-saver. Shota FUJI authored at Shota FUJI comitted at
  9. 67ae060c Update README Slightly outdated. Shota FUJI authored at Shota FUJI comitted at
  10. bd275169 Fix GET / is 404 when non-git repository exists in scanPath https://tangled.org/pocka.jp/legit/issues/20 Regression introduced in e31c3f8f4e4271038ef02560da68c6154b2e6121 Shota FUJI authored at Shota FUJI comitted at
  11. f4085ceb Add option to group repositories by category https://tangled.org/pocka.jp/legit/issues/17 Category grouping is convenient for telling project's state and/or kind (mirror, fork, demo.) My hosted instance serves 19 repositories yet it's messy and hard to see an overview. Shota FUJI authored at Shota FUJI comitted at
  12. 8e0d9c46 Read description from git config Align with gitweb's behavior. Shota FUJI authored at Shota FUJI comitted at
  13. db55fd92 Fix test repository shares git directory and worktree Possible, but not practical. Shota FUJI authored at Shota FUJI comitted at
  14. e31c3f8f Use os.Root for path checking os.Root uses system primitive rather than stringy securejoin. Ideally, git.Open should accept fs.FS (or *os.Root) but go-git in its current form (even v6) does not expose a function for "smart" open method that can open both bare and non-bare repositories. This patch also accidentally fixes following bugs: * checked out "description" file in a non-bare repository is treated as a description file. * ignored repository reveal using URL-encoded slashes (see the second test added in the parent commit) Load tests on a minimal setup (nix run .#testing) shows no differences before and after this patch. This is not a clean solution, but code is less duplicated and more correct and secure. I may revisit and refactor in near future. Shota FUJI authored at Shota FUJI comitted at
  15. eaeadc91 Add tests for path traversal Shota FUJI authored at Shota FUJI comitted at
  16. 43984419 Remove unused EditorConfig rule Shota FUJI authored at Shota FUJI comitted at
  17. e869ba63 Delete GitHub Actions workflow file Shota FUJI authored at Shota FUJI comitted at
  18. b92f7c89 Add relative time to commit timestamps' tooltip At first I tried to put these datetime formatting code into preferences file. But it didn't work well due to increased load time = content flashing. Shota FUJI authored at Shota FUJI comitted at
  19. 4059aa1e Override <select> UA styles Chromium (Linux) uses insanely low-contrast colors on dark mode. Shota FUJI authored at Shota FUJI comitted at
  20. 66cdbc5a Workaround degraded UX due to BFCache BFCache is the worst thing happened in the web. The technology itself is not bad, but how it's introduced (or who introduced) was the problem. A company that tries to advertise their hardware, or accurately say, deceive their hardware's customer to them believing their hardware is faster than competitors, started deplying BFCache widely to their browser that is only available one on the hardware. Because the intention, and there is no spec for back/forward behavior, they introduced the behavior to existing web pages without opt-out mechanism. Their defence is "this is good for users, and only situation this is not desirable is navigation after logout", which is completely bullshit. Client-side apps relies on established "script reload on navigation" were broken and had to add workaround or adapt to this breaking change. They didn't care as their goal is to create software monopoly using their proprietry app store, and web apps are "competitor" to those motherfuckers' products. I could have set "Cache-Control: no-store" but decided to "adapt" BFCache because: * disabling BFCache by using that header is side-effect, so "primary effect" takes place (I have a plan for cache design and this is not a good time to introduce the change) * those mfs can change heuristic or break web by another method, and this is more future-proof. Avoiding (fighting against) the cache is a hack, unfortunately. * whether showing cached content is good in this software is debatable, but considering there is no cache design yet, supporting BFCache is better than the prior state. The new code has consistent code style albeit little bit inefficient on storage access. I believe future changes naturally will follow this pattern and will put "sync" code into "pageshow" handler. Shota FUJI authored at Shota FUJI comitted at
  21. 22ff30a7 Add preferences for file tree The default is wasteful for my taste. Shota FUJI authored at Shota FUJI comitted at
  22. 9593ebb6 Add theme color preferences (JS) I hate the default blue convention. Shota FUJI authored at Shota FUJI comitted at
  23. f9ad53cb Move tab width selector into preferences dialog I'm going to add other options as well. Shota FUJI authored at Shota FUJI comitted at
  24. 99fddaf4 Set "color-scheme" HTML meta tag So UA applies their dark styles for unstyled elements. After this patch, tab width selector will use dark theme style provided by UA in dark mode. Shota FUJI authored at Shota FUJI comitted at
  25. 484117da Add CLI flags for development config fields These config fields are for developing legit itself. Changing config file in worktree then reverting that before commit is error-prone. Shota FUJI authored at Shota FUJI comitted at
  26. 95a55864 Refactor routes module file structure It was difficult to find a file containing what I want to edit. Shota FUJI authored at Shota FUJI comitted at
  27. b90b105e Hide public functions not used outside routes module I was, and still occasionally am, confused by those. Shota FUJI authored at Shota FUJI comitted at
  28. 48a8e602 Rename routes.Handlers to routes.Handler *http.ServeMux implements http.Handler interface. It does not expose multiple handlers. Shota FUJI authored at Shota FUJI comitted at
  29. f483e5f0 Remove module version constraint for go-diff I could not find why it's there. Removing it did not cause panic or visible changes on diff view so I assume the bug or whatever was fixed. Shota FUJI authored at Shota FUJI comitted at
  30. 8640d6af Profiling pages (debug build only) To optimize this software more, I need profilier to see which part is taking a time. Shota FUJI authored at Shota FUJI comitted at