Skip to main content

Module git_ui

Module git_ui 

Source
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Β§

BranchEntry πŸ”’
BranchNav πŸ”’
One entry in the branch-switcher nav rendered on every log page.
ChangedFile πŸ”’
CommitInfo πŸ”’
A single commit’s metadata, passed to Tera templates. Clone is required so commits can be deduplicated across branches.
CommitParent πŸ”’
DiffLine πŸ”’
RefBadge πŸ”’
A ref badge shown next to a commit hash on log pages.
RefInfo πŸ”’

EnumsΒ§

DiffLineKind πŸ”’
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 indicatif spinner (interactive terminals) or logs via tracing::info! (dumb / piped terminals).
RefBadgeKind πŸ”’
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 empty GlobSet, 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 max commits reachable from tip, newest first.
collect_refs πŸ”’
Collect tags and branches for the refs overview page.
export_bare_clone πŸ”’
Clone source as a bare repository at dest, then prune it down to the branches/tags allowed by git_ui.include/git_ui.exclude before 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 -p into per-file ChangedFile entries.
parse_message πŸ”’
Split a raw commit message into (subject, optional body).
prune_excluded_refs πŸ”’
Delete every branch/tag in the bare clone at dest that doesn’t pass git_ui.include/git_ui.exclude (see ref_is_included), then run git gc --prune=now so 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, per git_ui.exclude/git_ui.include.