shortRev returns the first 7 chars of the locked git rev, or "" for refs without one (path:, tarball:, unlocked refs).
(resolved string)
| 275 | // shortRev returns the first 7 chars of the locked git rev, or "" for refs |
| 276 | // without one (path:, tarball:, unlocked refs). |
| 277 | func shortRev(resolved string) string { |
| 278 | installable, err := flake.ParseInstallable(resolved) |
| 279 | if err != nil || installable.Ref.Rev == "" { |
| 280 | return "" |
| 281 | } |
| 282 | if len(installable.Ref.Rev) < 7 { |
| 283 | return installable.Ref.Rev |
| 284 | } |
| 285 | return installable.Ref.Rev[:7] |
| 286 | } |
| 287 | |
| 288 | func shortDate(rfc3339 string) string { |
| 289 | if rfc3339 == "" { |