legit

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

  1. 1
  2. 2
  3. 3
  4. 4
  5. 5
  6. 6
  7. 7
  8. 8
  9. 9
  10. 10
  11. 11
  12. 12
  13. 13
  14. 14
  15. 15
  16. 16
  17. 17
  18. 18
  19. 19
  20. 20
  21. 21
  22. 22
  23. 23
  24. 24
  25. 25
  26. 26
  27. 27
  28. 28
  29. 29
  30. 30
  31. 31
  32. 32
  33. 33
  34. 34
  35. 35
  36. 36
  37. 37
  38. 38
  39. 39
  40. 40
  41. 41
  42. 42
  43. 43
  44. 44
  45. 45
  46. 46
  47. 47
  48. 48
  49. 49
  50. 50
  51. 51
  52. 52
  53. 53
  54. 54
  55. 55
  56. 56
  57. 57
  58. 58
  59. 59
  60. 60
  61. 61
  62. 62
  63. 63
  64. 64
  65. 65
  66. 66
  67. 67
  68. 68
  69. 69
  70. 70
  71. 71
  72. 72
  73. 73
  74. 74
  75. 75
  76. 76
  77. 77
  78. 78
  79. 79
  80. 80
  81. 81
  82. 82
  83. 83
  84. 84
  85. 85
  86. 86
  87. 87
  88. 88
  89. 89
  90. 90
  91. 91
  92. 92
  93. 93
  94. 94
  95. 95
  96. 96
<!--
Copyright 2026 Shota FUJI <pockawoooh@gmail.com>
SPDX-License-Identifier: MIT
-->

# Changelog

## v1.2.0

### New Features

- Added `repo.diff` config option / CLI flag to select `go` (pure Go diff implementation, default) or `system` (system install git, much faster) for generating diffs.
- Added `ui.diff.hideThresholdLines` config option to collapse large diffs.
- Added `repo.trimDotGitSuffix` config option to serve bare repositories without `.git` suffix. You can still access `/<name>.git/*` paths when this option is enabled.

### Bug Fixes

- Fixed pages for a ref including slash character (e.g., `feature/foo`) not working.
- Removed double-slash from links on tree page.

### Other Changes

- Reduced reflow / screen flickering on commit page.

## v1.1.0

### New Features

- Grouping repositories by gitweb-compatible category (opt-in, see the added `ui.category.*` options). For how to set a category for a repository, wefer to [gitweb's document](https://git-scm.com/docs/gitweb#Documentation/gitweb.txt-categoryorgitwebcategory).
- Added "Preferences" dialog to let users (visitors) allow customize theme color and file list appearance.
- Tooltip on commit / author datetime now has relative time. E.g., 1 year ago
- When `$DIR_DIR/description` file is absent, legit now reads `gitweb.description` git config and use it as a description text, for gitweb compatibility.
- Added `staticDirRevision` config / build flag for browser-cache busting.

### Bug Fixes

- Fixed `git clone` and `git fetch` are unavailable on OCI image.
- Fixed ignored repository reveal using URL-encoded slash character, such as `.%2Fprivate_repo`.
- Fixed `description` file in a checked out worktree being treated as a description file.
- Fixed broken layout of 404/500 pages.

### Security

- Switched to more robust repository directory path check for more secure filesystem access outside OpenBSD and Linux.

### Other Changes

- Tab width selector has been moved to the new "Preferences" dialog.
- Made the repository list page (`/`) cache-friendly by outputting timestamp rather than relative time. If user enabled JS in a browser, this change is effectively no-op.
- Added `-compileTemplatesOnRequest`, `-dirs.static` and `-dirs.templates` CLI flags.
- Fixed links that always 307 redirects due to lack of trailing slash.

## v1.0.0

This entry states changes from the original legit.

### New Features

- Completely new default CSS / HTML for better screen real estate utilization.
- Customizable page footer.
- Tab-width selector (requires JavaScript.)
- Pagination for commits (log) page.
- HTML preview for Markdown files on blob page.
- Image display support for Markdown files, both on blob page and summary page.
- New CLI flags: `-server.host`, `-server.port`, `-repo.scanPath`.

### Removed Features

- [go-import](https://go.dev/ref/mod#vcs-find) support: Go cannot handle `.git` extension and legit has no option to trim the extension.
- Syntax highlight theming: HTML no longer contains hardcoded colors, so edit CSS for theme customization.

### Bug Fixes

- Ignored repositories are no longer clonable / fetchable. ([icyphox/legit#56](https://github.com/icyphox/legit/issues/56), [pocka.jp/legit#2](https://tangled.org/pocka.jp/legit/issues/2))
- `git fetch` errors when Git client compress request with Gzip. ([icyphox/legit#58](https://github.com/icyphox/legit/pull/58))
- Fix Nix derivation no declaring `git` dependency.
- Paths inside config file are now resolved from the config file, rather than working directory.

### Performance

- Stop generating HTML sanitizers policy object on each request, slightly improved Markdown and README rendering. ([pocka.jp/legit#4](https://tangled.org/pocka.jp/legit/issues/4))
- Improved the summary page's response time, especially for repositories with many commits, by fixing the code loads an entire commit history for "Recent commits".

### Security

- Use Landlock LSM for filesystem access restriction, similar to unveil(2) on OpenBSD. ([pocka.jp/legit#13](https://tangled.org/pocka.jp/legit/issues/13))

### Other Changes

- Data type of template variables (data passed Go template) are defined in `routes/data.go`.
- You can start legit without `-config` option, as long as you provide `-repo.scanPath` CLI flag.
- Easy to use `Dockerfile` (only web interface. `git clone` and `git fetch` is not available for now.)
- Added NixOS module and Home Manager module to Nix Flake file.
- Default templates and static files are embedded in the binary. You can omit `dirs.templates` and `dirs.static` options. ([icyphox/legit#10](https://github.com/icyphox/legit/issues/10))
- Upgraded chroma package from v2.14 to v2.27. Blob page highlights more languages.
- Upgraded go-git package from v5.6 to v5.13.