MCPcopy Index your code
hub / github.com/jetify-com/devbox / describeFlakeUpdate

Function describeFlakeUpdate

internal/devbox/update.go:264–273  ·  view source on GitHub ↗

describeFlakeUpdate renders a short human-readable diff between two flake lockfile entries. It prefers short revs when both sides have them, falls back to a date range when not, and omits either piece cleanly if missing.

(existing, resolved *lock.Package)

Source from the content-addressed store, hash-verified

262// lockfile entries. It prefers short revs when both sides have them, falls
263// back to a date range when not, and omits either piece cleanly if missing.
264func describeFlakeUpdate(existing, resolved *lock.Package) string {
265 var parts []string
266 if oldRev, newRev := shortRev(existing.Resolved), shortRev(resolved.Resolved); oldRev != "" && newRev != "" {
267 parts = append(parts, fmt.Sprintf("%s -> %s", oldRev, newRev))
268 }
269 if oldDate, newDate := shortDate(existing.LastModified), shortDate(resolved.LastModified); oldDate != "" && newDate != "" {
270 parts = append(parts, fmt.Sprintf("(%s → %s)", oldDate, newDate))
271 }
272 return strings.Join(parts, " ")
273}
274
275// shortRev returns the first 7 chars of the locked git rev, or "" for refs
276// without one (path:, tarball:, unlocked refs).

Callers 2

Calls 2

shortRevFunction · 0.85
shortDateFunction · 0.85

Tested by 1