Artifact 39f4ffa33a4cd73e505c76df7e36fae31c2f8d16482e2d1ec9c3035f501cfc26:
- File
cli/repo_timeline.go
— 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: 732) [annotate] [blame] [check-ins using]
package cli import ( "fmt" libfossil "github.com/danmestas/libfossil" ) // RepoTimelineCmd shows repository timeline/history. type RepoTimelineCmd struct { Limit int `short:"n" default:"20" help:"Number of entries"` } func (c *RepoTimelineCmd) Run(g *Globals) error { r, err := g.OpenRepo() if err != nil { return err } defer r.Close() tipRid, err := resolveRID(r, "") if err != nil { return err } entries, err := r.Timeline(libfossil.LogOpts{Start: tipRid, Limit: c.Limit}) if err != nil { return err } for _, e := range entries { uuid := e.UUID if len(uuid) > 10 { uuid = uuid[:10] } fmt.Printf("%s %s %s %s\n", uuid, e.Time.Format("2006-01-02 15:04"), e.User, e.Comment) } return nil }