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
This commit is contained in:
lotherk committed 2026-11-22 15:55:27 +00:00
1 parent 8189516c49
commit 1408773068
2 files changed
+16 -6

No files matched your search

+13 -4
View File
@@ -12,8 +12,9 @@ storage.
- Main module `gotea.dev`; binary `gotea`. Identity strings and the English locale - Main module `gotea.dev`; binary `gotea`. Identity strings and the English locale
are renamed; upstream copyright notices stay. are renamed; upstream copyright notices stay.
- The Go backend still calls `modules/git` for most operations. Bare repository - The Go backend still calls `modules/git` for most operations. Bare repository
creation, `IsEmpty`, `GetDefaultBranch`, `SetDefaultBranch`, and creation, `IsEmpty`, `GetDefaultBranch`, `SetDefaultBranch`,
`GetBranchCommitID` now go through `modules/got`; the rest of the migration is open. `GetBranchCommitID`, and `GetBranchNames` now go through `modules/got`; the rest
of the migration is open.
- `cgi/gotea-cgi` is the read-only old-browser frontend. It browses bare - `cgi/gotea-cgi` is the read-only old-browser frontend. It browses bare
repositories with `got`; it does not authenticate and has no write path. repositories with `got`; it does not authenticate and has no write path.
- Gotea Pages is a prototype: a `pages` branch is checked out with got, built - Gotea Pages is a prototype: a `pages` branch is checked out with got, built
@@ -99,11 +100,19 @@ make test-migration # after modelmigration changes
- Put every got invocation in `modules/got` (replacing `modules/git`). Nothing else - Put every got invocation in `modules/got` (replacing `modules/git`). Nothing else
execs got or parses repository internals. Bare init, empty state, default-branch execs got or parses repository internals. Bare init, empty state, default-branch
read/write, and branch ID lookup are already there; non-bare temp worktrees still read/write, branch ID lookup, and branch listing are already there; non-bare temp
use git and must be migrated deliberately. worktrees still use git and must be migrated deliberately.
- `[git] GOT_PATH` selects the got binary (default `got`). - `[git] GOT_PATH` selects the got binary (default `got`).
- `SetDefaultBranch` uses `got ref -s` for existing branches and writes HEAD - `SetDefaultBranch` uses `got ref -s` for existing branches and writes HEAD
atomically for unborn branches, because `got ref -s` requires the target to exist. atomically for unborn branches, because `got ref -s` requires the target to exist.
- `run` validates every `-r` target before calling got. got searches upwards, so a
path that is not a repository would otherwise answer with an enclosing one - a
wrong answer, not an error. The same hook recreates `objects/pack` and `refs/`
when a checkout dropped those empty directories, because got refuses such a repo.
- `Branches` lists names from `got ref -l refs/heads/`, never `got branch -l`: the
latter also reports `refs/remotes/` copies and can repeat a name. It takes the
order from `got branch -lt` and appends any name that pass missed, so a failure
there degrades to the lexical order instead of failing the listing.
- File changes require a **work tree**, whose metadata is `.got/` (not `.git/`). - File changes require a **work tree**, whose metadata is `.got/` (not `.git/`).
A bare repository cannot be edited in place: server-side edits and merges need a A bare repository cannot be edited in place: server-side edits and merges need a
temporary `got checkout` work tree and a `got commit`. Serialize per repository temporary `got checkout` work tree and a `got commit`. Serialize per repository
+3 -2
View File
@@ -130,8 +130,9 @@ contrast failures (925/945 pass), which do not affect the build path.
## Backend got migration ## Backend got migration
Bare repositories are created with `got init` through `modules/got`, and Bare repositories are created with `got init` through `modules/got`, and
`IsEmpty`, `GetDefaultBranch`, `SetDefaultBranch`, and `GetBranchCommitID` use got. Unborn branches `IsEmpty`, `GetDefaultBranch`, `SetDefaultBranch`, `GetBranchCommitID`, and
write HEAD atomically because `got ref -s` requires the target branch to exist. `GetBranchNames` use got. Unborn branches write HEAD atomically because
`got ref -s` requires the target branch to exist.
`GOT_PATH` in the `[git]` section selects the binary (default `got`). Non-bare `GOT_PATH` in the `[git]` section selects the binary (default `got`). Non-bare
temporary worktrees and pushing still use git while the migration proceeds. temporary worktrees and pushing still use git while the migration proceeds.
There is no silent git fallback for the migrated paths. There is no silent git fallback for the migrated paths.