Sign in

Search issue titles and bodies, change requests and comments. Private repositories you cannot read are not included.

vole
Clone

Read only, no credentials:

https://rodent.software/git/vole.git

Write over SSH with a registered key:

git clone ssh://git@0.0.0.0:2222/vole.git

A free and open-source forge that lives in your Git repo.

#130

P2: Record the default branch summary when a push lands

closed · opened by keenan 9d ago

keenan opened this 9d ago

Why

The landing card shows the default branch tip (SHA, subject, author, time) and the language the repository is mostly made of. Until now it read all of that from git on every home page render: symbolic-ref to open the repository, rev-parse for the tip, log -1 for the subject and author, and ls-tree -r for the language — per repository, on the instance’s busiest page.

Those facts change only when a push moves the default branch, so a page read is the wrong place to compute them.

Scope

  • repos gains head_sha, head_subject, head_author, head_when, language and lang_class; index.Entry returns them with the rest of the row.
  • Store.RefreshHead recomputes the summary. It compares the recorded tip with the branch tip first, so a metadata or tag push costs one rev-parse and no tree walk. It runs from post-receive, from the rebuild, and after the default branch changes in settings.
  • The language mapping moves to internal/lang, shared by the web pages and the summary (one table instead of languageFor plus fileClass).
  • The home card reads head, language, counts, ACL and newest event time from the index. The home page starts no git process; the all-git card builder remains the fallback for a Web without an index.

Acceptance

  • After a push, the home card shows the pushed tip’s SHA, subject, author and language without any git call on the read.
  • A metadata-only or tag push does not walk the default branch’s tree.
  • Deleting the default branch clears the summary; a rebuild restores it from the repository.
  • Changing the default branch updates the card’s branch and summary.
  • The home page runs zero git child processes during a load run.

Notes

vole admin index rebuild recomputes every summary; a repository whose head was never recorded shows “No commits yet” until its next push or rebuild, which the schema-version reset already forces on upgrade.

Comments (0)

No comments yet.