~bigbes/sr-ht-dolt: 93e69910

storage: create databases empty so the first push needs no --force

Every automatic creation path wrote an "Initialize data repository"
commit through WriteEmptyRepo, and that commit is history. dolt decides
fast-forward on the client (actions.CanFastForward over the remotesapi),
so the server cannot forgive the collision: pushing a database that has a
root commit of its own — a beads tracker, anything grown locally — was
rejected as a non-fast-forward and could only land with --force. That is
the whole reason the companion-database recipe starts with a forced push.

push-to-create already provisioned an empty store for this exact reason.
Give the other two paths the same default: /internal/repos, whose caller
is git.sr.ht's post-update hook and therefore fires before its user has
ever pushed, now always provisions empty, and the web form does unless
its new "initialize with an empty commit" checkbox is ticked. The
checkbox buys what an empty store cannot offer — a database that can be
cloned before anything is pushed to it, since dolt refuses a store with
no commits as "contains no Dolt data".

Which is also why the overview of a database with no branches now teaches
push rather than clone: the clone box there quoted a command that could
not work. A store that fails to open is deliberately not treated as
empty — an unreadable database must not be advertised as a fresh one.

Eugene Blikh <bigbes@gmail.com> — 2026-08-15 09:09:58 UTC

Commit 93e699101e297244802590365e96da638404b579view raw patch

Parent(s): 3843eb55

11 changed file(s)

FileStatus+
cmd/doltsrht/main.go M +4
cmd/doltsrht/main_test.go M +4
docs/DESIGN.md M +10 -2
storage/init.go M +7
web/deps.go M +12
web/handlers_internal.go M +10 -24
web/handlers_internal_test.go M +11 -5
web/handlers_repo.go M +45 -10
web/templates/create.html M +14
web/templates/overview.html M +21
web/web_test.go M +105 -9