Expand description
Generates a static git web UI and clonable bare repository. Generates a static git repository web UI and a clonable bare clone.
Produces:
<output>/repository/- one HTML log page per branch, refs page, per-commit detail pages<output>/repository.git/- bare clone suitable for dumb HTTP serving
The branch named by git_ui.default_branch is rendered to index.html;
every other branch gets <sanitized-name>.html.
It also generates <output>/repository/browse/<hash>/ - a full recursive
static file tree browser with server-side syntax highlighting (via syntect),
generated for every branch tip and every tagged commit.
This is a site-level step called once from main.rs, not a per-version Builder.
StructsΒ§
- Branch
Entry π - Branch
Nav π - One entry in the branch-switcher nav rendered on every log page.
- Changed
File π - Commit
Info π - A single commitβs metadata, passed to Tera templates.
Cloneis required so commits can be deduplicated across branches. - Commit
Parent π - Diff
Line π - RefBadge π
- A ref badge shown next to a commit hash on log pages.
- RefInfo π
EnumsΒ§
- Diff
Line πKind - The visual kind of a single unified-diff line. Serialises as lowercase for use as a CSS modifier class.
- Progress π
- A lightweight progress reporter that either drives an
indicatifspinner (interactive terminals) or logs viatracing::info!(dumb / piped terminals). - RefBadge
Kind π - Discriminates the two kinds of ref badge shown on log pages.
Serialises as lowercase (
"tag"/"branch") for use as a CSS modifier class.
ConstantsΒ§
- TEMPLATE_
GIT_ BLOB_ GEMTEXT - TEMPLATE_
GIT_ BLOB_ HTML - TEMPLATE_
GIT_ COMMIT_ GEMTEXT - TEMPLATE_
GIT_ COMMIT_ HTML - TEMPLATE_
GIT_ LOG_ GEMTEXT - TEMPLATE_
GIT_ LOG_ HTML - TEMPLATE_
GIT_ REFS_ GEMTEXT - TEMPLATE_
GIT_ REFS_ HTML - TEMPLATE_
GIT_ TREE_ GEMTEXT - TEMPLATE_
GIT_ TREE_ HTML
FunctionsΒ§
- build_
git_ repository_ ui - build_
globset π - Compile a list of glob patterns (as written in
git_ui.exclude/include) into a [GlobSet]. An empty pattern list compiles to an emptyGlobSet, which matches nothing. - build_
ref_ πlabels - Build a map from commit hash (hex string) to the ref badges pointing at it. Tags come before branches within each entry; both are sorted alphabetically.
- collect_
branch_ πentries - Collect all local branches and assign output filenames.
- collect_
commits π - Walk at most
maxcommits reachable fromtip, newest first. - collect_
refs π - Collect tags and branches for the refs overview page.
- export_
bare_ πclone - Clone
sourceas a bare repository atdest, then prune it down to the branches/tags allowed bygit_ui.include/git_ui.excludebefore enabling the dumb HTTP transport. - generate_
clone_ command - get_
changed_ πfiles - make_
spinner π - Shared spinner style - matches the builder spinners in
site.rs. - parse_
diff_ πoutput - Parse the output of
git diff-tree -pinto per-fileChangedFileentries. - parse_
message π - Split a raw commit message into (subject, optional body).
- prune_
excluded_ πrefs - Delete every branch/tag in the bare clone at
destthat doesnβt passgit_ui.include/git_ui.exclude(seeref_is_included), then rungit gc --prune=nowso the excluded history isnβt merely unlisted but actually removed from what dumb HTTP ends up serving from disk. - ref_
is_ πincluded - Decide whether a ref (by its short name, e.g.
"main"or"v1.0.0") should appear in the generated UI, pergit_ui.exclude/git_ui.include.