23 Commits
Author SHA1 Message Date
lotherk f3298fb282 modules/git: migrate tag read lookups to got
giteabot backport / giteabot (push) Skipped
release-nightly-snapcraft / build-and-publish (ubuntu-24.04) (push) Canceled after 0s
release-nightly-snapcraft / build-and-publish (ubuntu-24.04-arm) (push) Canceled after 0s
release-nightly / nightly-binary (push) Canceled after 0s
release-nightly / nightly-container (push) Canceled after 0s
IsTagExist uses got ref existence in both builds. GetTagID resolves the
tag ref via got, GetTagNameBySHA lists refs/tags/ via got ref -l. GetTagInfos
and annotated-tag body parsing still use git for-each-ref/cat-file.

Verified: GOTMPDIR=/home/lotherk/.cache/gotmp go test ./modules/got ./modules/git -count=1
2026-11-24 06:59:04 +00:00
lotherk 1e81fa4a14 modules/git: resolve GetRefCommitID via got
giteabot backport / giteabot (push) Skipped
release-nightly-snapcraft / build-and-publish (ubuntu-24.04) (push) Canceled after 0s
release-nightly-snapcraft / build-and-publish (ubuntu-24.04-arm) (push) Canceled after 0s
release-nightly / nightly-binary (push) Canceled after 0s
release-nightly / nightly-container (push) Canceled after 0s
Resolve ref names through got ref -l instead of CatFileBatch/gogit ref
lookups. Plain object hashes are returned directly, as before. Missing
refs still map to ErrNotExist.

Verified: GOTMPDIR=/home/lotherk/.cache/gotmp go test ./modules/got ./modules/git -count=1
2026-11-24 06:54:46 +00:00
lotherk 264453a934 modules/git: resolve GetFullCommitID via got log
giteabot backport / giteabot (push) Skipped
release-nightly-snapcraft / build-and-publish (ubuntu-24.04) (push) Canceled after 0s
release-nightly-snapcraft / build-and-publish (ubuntu-24.04-arm) (push) Canceled after 0s
release-nightly / nightly-binary (push) Canceled after 0s
release-nightly / nightly-container (push) Canceled after 0s
Use got log -c <rev> -l1 to resolve short/full commit IDs and refs to a
full commit ID. This keeps the call on got for the commit-resolution path
used by pull/merge/compare flows; unknown revisions still map to
ErrNotExist.

Verified: GOTMPDIR=/home/lotherk/.cache/gotmp go test ./modules/got ./modules/git -count=1
2026-11-24 06:52:26 +00:00
lotherk 75fed4414d modules/git: migrate IsReferenceExist to got cat
giteabot backport / giteabot (push) Skipped
release-nightly-snapcraft / build-and-publish (ubuntu-24.04) (push) Canceled after 0s
release-nightly-snapcraft / build-and-publish (ubuntu-24.04-arm) (push) Canceled after 0s
release-nightly / nightly-binary (push) Canceled after 0s
release-nightly / nightly-container (push) Canceled after 0s
Route package-level and Repository.IsReferenceExist through
modules/got.ObjectExists, which probes `got cat -r` without -P. got cat
resolves full/abbreviated object IDs, refs and tags but not path names,
matching the commit_checker/merge_tree callers that pass commit IDs and
the ref callers that pass ref names.

This also removes the gogit/nogogit inconsistency where gogit rejected
blob hashes and short hashes for IsReferenceExist; the got-backed path
accepts them in both builds. IsObjectExist is left alone: its nogogit
CatFileBatch implementation has different semantics and its only caller
is marked FIXME.

Verified: GOTMPDIR=/home/lotherk/.cache/gotmp go test ./modules/got ./modules/git -count=1
2026-11-24 06:38:41 +00:00
lotherk 3c6b249810 feat(got): check branch and tag existence with got
giteabot backport / giteabot (push) Skipped
release-nightly-snapcraft / build-and-publish (ubuntu-24.04) (push) Canceled after 0s
release-nightly-snapcraft / build-and-publish (ubuntu-24.04-arm) (push) Canceled after 0s
release-nightly / nightly-binary (push) Canceled after 0s
release-nightly / nightly-container (push) Canceled after 0s
IsBranchExist and IsTagExist now ask got.RefExists instead of git's cat-file
batch. got's exit status is useless here: `got ref -l <unknown>` exits 0 with
no output, and an empty repository reports "HEAD: refs/heads/main" for a branch
that does not exist yet. The wrapper therefore parses the "<name>: <value>"
line and follows symbolic entries with a bounded depth.

IsReferenceExist/IsObjectExist keep the cat-file batch: they answer "is this
object present" for bare and short commit IDs, which got ref cannot, and
`got cat` resolves unknown arguments as paths in HEAD's tree, so it would
report file names as existing objects. That gap is documented, not silent.

Verified: go test ./modules/got ./modules/git (ref_test.go covers both ref
behaviours, the empty repository, and the enclosing-repository escape;
ref_got_test.go covers true/false branches and tags plus a missing got binary).
Full go test ./modules/... ./services/... ./models/... ./routers/... and
make -C cgi check pass.

Assisted-by: splinter:claude-opus-4
2026-11-22 18:02:34 +00:00
lotherk ebf3a54532 docs: drop the second remote, kropa is gotea's only push target
giteabot backport / giteabot (push) Skipped
release-nightly-snapcraft / build-and-publish (ubuntu-24.04) (push) Canceled after 0s
release-nightly-snapcraft / build-and-publish (ubuntu-24.04-arm) (push) Canceled after 0s
release-nightly / nightly-binary (push) Canceled after 0s
release-nightly / nightly-container (push) Canceled after 0s
Removed the hiddenbox remote and the 192.168.1.148 SSH bare repo from the
docs. Verified: git remote -v lists only origin (kropa) and upstream; branch
main tracks origin/main; tree clean.

Assisted-by: splinter:claude-opus-4
2026-11-22 17:35:21 +00:00
lotherk cbe42fa976 docs: record the two gotea remotes and the dead hiddenbox.org host
giteabot backport / giteabot (push) Skipped
release-nightly-snapcraft / build-and-publish (ubuntu-24.04) (push) Canceled after 0s
release-nightly-snapcraft / build-and-publish (ubuntu-24.04-arm) (push) Canceled after 0s
release-nightly / nightly-binary (push) Canceled after 0s
release-nightly / nightly-container (push) Canceled after 0s
git.hiddenbox.org answers 502, so the second remote is the SSH host used by
casadois. Verified: git push -u origin main (416s, 21850 commits) and
git push -u hiddenbox main both exit 0; git ls-remote shows
1408773068 on both. go build . and make -C cgi check pass.

Assisted-by: splinter:claude-opus-4
2026-11-22 16:19:48 +00:00
lotherk 1408773068 docs: record got branch listing and its two traps
giteabot backport / giteabot (push) Skipped
release-nightly-snapcraft / build-and-publish (ubuntu-24.04) (push) Canceled after 0s
release-nightly-snapcraft / build-and-publish (ubuntu-24.04-arm) (push) Canceled after 0s
release-nightly / nightly-binary (push) Canceled after 0s
release-nightly / nightly-container (push) Canceled after 0s
Branch listing moved to got, so the migration list and the got integration
notes now say GetBranchNames is covered. Also record the two got behaviours
the code has to guard: `-r` searching upwards on a non-repository path, and
got refusing a repository whose empty directories were lost.

Assisted-by: OpenCode:DeepSeek-V4.1-Flash
2026-11-22 15:55:27 +00:00
lotherk 8189516c49 feat(got): list branches with got
Add got.Branches and route both GetBranchNames implementations through it,
so branch listing no longer runs git for-each-ref.

Names come from `got ref -l refs/heads/`, not `got branch -l`: the latter
also reports refs/remotes copies and can print a name twice. Order comes
from `got branch -lt`; names that pass misses are appended, so a failure
there degrades to lexical order instead of failing the listing.

Two got behaviours needed guarding:

- `-r` searches upwards. A path that is not a repository made got answer
  for the enclosing one, so a broken fixture silently returned the parent
  repository's refs. run now validates the target first.
- got refuses a repository without objects/pack or refs/. Those are empty
  directories, so a fixture checked into git loses them. run recreates the
  layout, content-free and idempotent.

repo2_empty carried .gitkeep files under refs/heads and refs/tags; got reads
them as references and fails with "bad reference name". Dropped both, the
layout is now created on demand.

Tests: go test ./modules/got ./modules/git ./modules/git -tags gogit
./services/repository/... ./modules/repository/... ./models/git/...
./routers/web/repo/... ./services/context/... - all pass. New tests cover
ordering, paging, remote-copy filtering, the missing-directory repair, the
enclosing-repository refusal, and absence of a git fallback.

Assisted-by: OpenCode:DeepSeek-V4.1-Flash
2026-11-22 15:55:23 +00:00
lotherk 2051891fde feat(got): read branch commit IDs with got
Add BranchCommitID to modules/got and route GetBranchCommitID through it. Cover existing and missing branches and the no-fallback case.

Assisted-by: OpenCode:DeepSeek-V4.1-Flash
2026-11-22 15:23:05 +00:00
lotherk d6bb7fb157 feat(got): set default branch via got and atomic HEAD
Use got ref -s when the target branch exists and write HEAD atomically for unborn branches, where got ref -s cannot operate. Route git.SetDefaultBranch through the got wrapper and cover both paths plus the no-bypass case in tests.

Assisted-by: OpenCode:DeepSeek-V4.1-Flash
2026-11-22 15:21:27 +00:00
lotherk 34cfc1e12b feat(got): read empty state and default branch with got
Add IsEmpty and DefaultBranch to modules/got and route Repository.IsEmpty and GetDefaultBranch through them. Keep SetDefaultBranch on git because got ref -s requires the target branch to exist, which excludes unborn branches. Cover the wiring and the no-fallback behaviour with tests.

Assisted-by: OpenCode:DeepSeek-V4.1-Flash
2026-11-22 15:19:23 +00:00
lotherk 0e54cb8a02 feat(cgi): switch branches and tags with ?ref
Read the ref query parameter, validate it, pass it to got for tree, blob, raw, and log views, and render a no-JavaScript branch/tag bar. Preserve the ref in repository links and cover dev/main switching and traversal rejection in tests.

Assisted-by: OpenCode:DeepSeek-V4.1-Flash
2026-11-22 14:08:02 +00:00
lotherk 4be6c78264 feat(got): initialize bare repositories with got
Add modules/got with a got runner, version check, repository detection, and idempotent bare init. Route bare repository creation from InitRepositoryLocal through got; non-bare temp worktrees keep git. Add [git] GOT_PATH and tests, including an explicit no-fallback test.

Assisted-by: OpenCode:DeepSeek-V4.1-Flash
2026-11-22 14:05:07 +00:00
lotherk 1a62123fad feat(cgi): accept CDE .dp palettes
Parse eight-slot CDE palette files in addition to key=value themes. Map the active frame, inactive frame, text-area, application-background and front-panel slots, derive readable text and code colours, and add a sample palette plus tests.

Assisted-by: OpenCode:DeepSeek-V4.1-Flash
2026-11-22 12:35:18 +00:00
lotherk 623b14f058 docs: record got worktree ref cleanup
Assisted-by: OpenCode:DeepSeek-V4.1-Flash
2026-11-22 12:32:18 +00:00
lotherk 17156e1d97 fix(pages): remove got worktree refs after publishing
Every got checkout creates refs/got/worktree/base-<uuid> in the bare repo. Delete it in the publisher trap so repeated pushes do not accumulate refs and block object cleanup, and assert the ref count stays stable in the hook test.

Assisted-by: OpenCode:DeepSeek-V4.1-Flash
2026-11-22 12:32:06 +00:00
lotherk a5ac6bf52f fix(cgi): normalize SCRIPT_NAME when mounted at root
A CGI mounted at / produced scheme-relative // links. Strip trailing slashes from SCRIPT_NAME, emit root-relative links, and cover the root mount in the pages tests.

Assisted-by: OpenCode:DeepSeek-V4.1-Flash
2026-11-22 12:30:49 +00:00
lotherk a5bc30bfaa fix(cgi): match pages host via SERVER_NAME fallback
CGI servers are not required to set HTTP_HOST. Fall back to SERVER_NAME:SERVER_PORT, omitting 80 and 443, and document the pages host contract. Also omit the redundant Status header on 200 file responses.

Assisted-by: OpenCode:DeepSeek-V4.1-Flash
2026-11-22 12:29:28 +00:00
lotherk 802572bae9 feat(pages): build and publish bb sites on push
Add a Gotea Pages prototype: a pages branch is checked out with got, built with the vendored bb, swapped atomically into a pages root, and served only on a separate host from an allowlist. A post-receive hook installer wires the flow through Gitea delegate hooks. The CGI pages mode isolates the host and contains paths with realpath.

Assisted-by: OpenCode:DeepSeek-V4.1-Flash
2026-11-22 12:28:02 +00:00
lotherk 3eae0cc954 build: vendor bb static site generator
Vendor the C99 bb sources, share directory, tests and man page under third_party/bb (MIT, upstream f5373fb) and add a make bb target. A checkout can now build project sites without an installed bb.

Assisted-by: OpenCode:DeepSeek-V4.1-Flash
2026-11-22 12:27:43 +00:00
lotherk feda8568da feat(cgi): add HTML 4.01 CDE frontend
Add a C99/POSIX CGI browser for bare Git-format repositories, using got for every read. Pages are HTML 4.01 Transitional with CSS1, table layout, no JavaScript, and a configurable CDE/Motif palette. The browser supports flat and owner-scoped repository layouts, tree, blob, raw, log, and commit views, and has tests plus generated-page validation.

Assisted-by: OpenCode:DeepSeek-V4.1-Flash
2026-11-22 12:14:26 +00:00
lotherk 1b490485ff refactor: import Gotea from Gitea v28.4.0
Rename the main module to gotea.dev and the binary to gotea, and update the application name and English locale. Keep the external gitea.dev/sdk and gitea.dev/actionslib module imports unchanged.

Assisted-by: OpenCode:DeepSeek-V4.1-Flash
2026-11-22 12:13:09 +00:00