Skip to content
go-libfossil Documentation
Login

Documentation


title: Migration from Fossil

weight: 30

This guide is for users of upstream Fossil SCM (the C binary distributed by fossil-scm.org) who are evaluating libfossil — a pure-Go implementation of the Fossil repository format and sync protocol.

It is intentionally honest about gaps. If a capability is not listed under "Command coverage" below, assume it is not implemented yet.

For a structural overview of how libfossil is organised — the package layout, storage model, and pluggable axes — see Architecture.

Repo format compatibility

libfossil reads and writes the same on-disk .fossil SQLite repository format as upstream Fossil. A repository created by either tool can be opened by the other at the file level — there is no import/export step and no data migration is needed. Both implementations share the same blob table layout, manifest/control artifact encoding, and delta chain representation.

One caveat: features introduced in very recent upstream Fossil releases (bleeding-edge artifact card types, new Fossil-specific SQL functions used in triggers) may not yet be parsed by libfossil. Stable Fossil repositories from the last several years round-trip cleanly.

Binary name and invocation

The compiled binary is named libfossil (not fossil) to avoid $PATH collisions when both tools are installed on the same machine:

go install github.com/danmestas/libfossil/cmd/libfossil@latest

libfossil uses a subcommand-grouped syntax: the top-level group is repo, and individual operations live beneath it. Upstream Fossil uses a flat command style. Examples:

Upstream Fossil libfossil
fossil clone URL repo.fossil libfossil repo clone URL repo.fossil
fossil ci -m "msg" file.txt libfossil -R repo.fossil repo ci -m "msg" file.txt
fossil timeline libfossil -R repo.fossil repo timeline

The -R <path> flag selects the repository and is a global flag (before the repo subcommand group).

Command coverage

The following repo subcommands are implemented today. Every entry below corresponds to a registered Kong command in cli/repo.go in the libfossil source tree.

Repository creation

Working tree and checkout

History and inspection

Branching and merging

Collaboration and admin

Known gaps vs. upstream Fossil CLI

The following upstream commands have no libfossil equivalent today:

What's not supported yet

Beyond the gaps listed above, several broader features of upstream Fossil are not yet exposed by libfossil:

If any of these are load-bearing for your workflow, stay on upstream Fossil for now.

Interop patterns

Where libfossil shines is in environments where the upstream C binary is inconvenient to run:

See examples/ (planned) for concrete starting points. Until those land, cmd/libfossil/main.go is the shortest working example of wiring the CLI package into a binary.