Artifact 3b13fe61c29f716cdfc4114694b79f5a41055239bd4e3fa83479f7ec7d4b3b86:
- File
cli/repo_annotate.go
— part of check-in
[1823fe8ca8]
at
2026-10-23 02:16:05
on branch feat/horizon-cones
— feat(annotate): report lines from at or below a structural horizon
draft-fossil-horizon-00 ยง5.5 requires an operation needing history below the horizon to detect the crossing and name the horizon. Annotating back past C stopped at the parent the store does not hold and credited every remaining line to the oldest version it reached, presenting a guess as an attribution.
The walk now asks content.BelowHorizon about the parent it could not load; when it lies below the structural horizon, the lines left without credit are marked BelowHorizon and reported against the horizon's check-in. The public AnnotatedLine carries the flag, and repo annotate prints such lines against ^<horizon> with one trailing note naming the horizon and repo cone deepen. A content horizon holds every manifest, so BelowHorizon never fires there; a conformance case clones both depths to show it. HZ-5.5-1 is now covered for every operation it lists. (user: [email protected], size: 1396) [annotate] [blame] [check-ins using] [more...]
package cli import ( "fmt" libfossil "github.com/danmestas/go-libfossil" ) // RepoAnnotateCmd annotates file lines with version history. type RepoAnnotateCmd struct { File string `arg:"" required:"" help:"File to annotate"` Version string `help:"Starting version (default: tip)"` } func (c *RepoAnnotateCmd) Run(g *Globals) error { r, err := g.OpenRepo() if err != nil { return err } defer r.Close() startRID, err := resolveCheckin(r, c.Version) if err != nil { return err } lines, err := r.Annotate(libfossil.AnnotateOpts{ FilePath: c.File, StartRID: startRID, }) if err != nil { return err } horizon := "" for _, l := range lines { uuid := l.UUID if len(uuid) > 10 { uuid = uuid[:10] } if l.BelowHorizon { // The line's origin is not held: mark the horizon, as git blame // marks a boundary commit, rather than credit its check-in. horizon = l.UUID fmt.Printf("^%s %8s %10s | %s\n", uuid, "horizon", "", l.Text) continue } fmt.Printf("%s %8s %s | %s\n", uuid, l.User, l.Date.Format("2006-01-02"), l.Text) } if horizon != "" { fmt.Printf("^ lines originate at or below the structural horizon at %s, whose history is not held here; "+ "deepen the horizon (repo cone deepen CHECKIN) to attribute them\n", horizon) } return nil } // RepoBlameCmd is an alias for annotate. type RepoBlameCmd struct { RepoAnnotateCmd }