Artifact 2d64ec9da99ef7b8d80f8b3906916259fe2a7d4d8e0bfc7588b62f86c8483be1:
- Executable file
.githooks/pre-commit
— part of check-in
[f5744359d3]
at
2026-04-19 16:30:54
on branch trunk
— Initial open source release
libfossil is a pure-Go implementation of the Fossil SCM, reading and writing the same .fossil SQLite repository format as upstream Fossil.
This is the first public release of code that previously lived in a private repository. The module path is github.com/danmestas/libfossil and the binary is named libfossil to avoid $PATH collisions with upstream fossil.
Included: - Repo lifecycle (create, clone), checkout/checkin, timeline, merge, diff, annotate, shun, tag, branch, bisect, stash, undo/redo - Sync-over-HTTP protocol (client and handler) - Two SQLite drivers: modernc (pure Go, default) and ncruces (wasm-capable) - Observer interfaces (SyncObserver, CheckoutObserver) with an optional OpenTelemetry implementation in observer/otel (separate submodule) - Deterministic simulation testing harness with BUGGIFY fault injection - Kong-based embeddable CLI under cli/ and a standalone binary under cmd/libfossil/ (user: [email protected], size: 1003) [annotate] [blame] [check-ins using]
#!/bin/sh # libfossil pre-commit hook # Runs tests with both SQLite drivers + DST + OTel sub-module (~45s) before every commit. # # Install: git config core.hooksPath .githooks # Skip: git commit --no-verify (emergency only) set -e run_test() { label="$1" shift if output=$("$@" 2>&1); then echo " $label: OK" else echo " $label: FAILED" echo "" echo "$output" echo "" exit 1 fi } echo "=== pre-commit: modernc (default) ===" run_test "unit tests" go test ./... -short -count=1 -timeout=120s echo "=== pre-commit: ncruces ===" run_test "unit tests (ncruces)" go test -tags test_ncruces ./... -short -count=1 -timeout=120s echo "=== pre-commit: vet ===" run_test "go vet" go vet ./... echo "=== pre-commit: observer/otel ===" run_test "otel sub-module" sh -c "cd observer/otel && GOWORK=off go test ./... -short -count=1 -timeout=30s" echo "=== pre-commit: build libfossil binary ===" run_test "cmd/libfossil" go build ./cmd/libfossil/ echo "=== pre-commit: all passed ==="