Skip to content
go-libfossil Today In History
Login

Today In History

This Day In History For 2027-05-04

1 Year Ago (more context)

2026-05-04
19:03 • Edit [764a82ecdb]: Add tag "v0.5.0" with note "- **`Repo.UUIDFromRID(rid int64) (string, error)`** — public lookup that returns the UUID for a given RID, replacing the consumer pattern of reaching into `r.DB()` to run `SELECT uuid FROM blob WHERE rid = ?`. Returns `ErrArtifactNotFound` (matchable via `errors.Is`) when the RID does not exist. (#23, #25) - **`Repo.Diff` accepts `filePath == ""` for whole-checkin diffs.** When called with an empty `filePath`, `Diff` now returns one `DiffEntry` per file changed between `ridA` and `ridB`, deterministically ordered by name. The single-file form (non-empty `filePath`) is unchanged. (#24, #26)

None. Both changes are purely additive at the public API surface. Calls to `Repo.Diff` with a non-empty `filePath` behave exactly as before.

- Consumers (bones, EdgeSync) can drop their hand-rolled `ridToUUID` helpers in favor of `Repo.UUIDFromRID`. The `errors.Is(err, libfossil.ErrArtifactNotFound)` check replaces ad-hoc `sql.ErrNoRows` matching. - Consumers building whole-checkin diffs (e.g. EdgeSync's `Agent.Diff`) can replace the manual `ListFiles` + per-file `Diff` enumeration with a single `repo.Diff(ridA, ridB, "")` call. - **Known limitation in whole-checkin Diff:** rename detection and permission-only changes are not yet reflected — pure renames currently surface as add+delete pairs. The underlying `mlink` walk needed to fix this is tracked separately and will land in a follow-up release. The single-file `Diff` codepath has the same limitation today, so behavior is consistent across both forms.". artifact: 1ac821e30c user: [email protected]

18:59
feat: support whole-checkin diff via empty filePath (#26)

Repo.Diff has a multi-file return shape ([]DiffEntry) but previously rejected filePath == "" with "filePath is required". Consumers that wanted a whole- checkin diff (the equivalent of `git diff revA..revB` or `fossil diff --from revA --to revB`) had to enumerate changed files themselves and call Diff per file; EdgeSync's Agent.Diff is the in-tree example of that workaround.

This relaxes the guard: when filePath == "", Diff now returns one DiffEntry per file that changed between ridA and ridB, sorted by Name for deterministic ordering. The non-empty filePath path is unchanged. Identical checkins return ([]DiffEntry{}, nil).

Whole-checkin enumeration is name-keyed (union of files across both manifests where the content UUID differs or the file exists on only one side). Proper rename detection via mlink (so a pure rename produces a single entry rather than an add+delete pair) and permission-only change reporting are deferred to a follow-up; the limitation is documented on Diff's godoc and called out in the PR description. The single-file path is unaffected.

The previous TestDiff_EmptyFilePath (which asserted the rejection error) is replaced with positive coverage for identical checkins, single-file change, multi-file change, addition-only, and deletion-only.

closes #24 check-in: 764a82ecdb user: [email protected] tags: trunk, v0.5.0

18:59 • Edit [764a82ecdb]: Add tag "v0.5.0". artifact: b4781b61c2 user: [email protected]
18:59
feat: add Repo.UUIDFromRID for public rid->uuid lookup (#25)

Consumers (bones, EdgeSync) currently bypass the methods-only Repo API to convert RIDs to UUIDs by reaching into r.DB() and running raw SQL. The lookup is well-defined and recurs throughout the libfossil internals; expose it as a first-class method.

Add Repo.UUIDFromRID(rid int64) (string, error) backed by a small internal helper Repo.UUIDByRID on internal/repo so the SELECT lives in one place. Missing rids surface ErrArtifactNotFound (wraps sql.ErrNoRows behind a typed sentinel) with the rid in the message.

closes #23 check-in: 61aa4dd022 user: [email protected] tags: trunk