Show only first 10-character prefix of the sha1.
This commit is contained in:
parent
9074bf1992
commit
1eac3e1d28
|
@ -34,8 +34,10 @@
|
||||||
(file-or-directory-modify-seconds this-file))))])
|
(file-or-directory-modify-seconds this-file))))])
|
||||||
(let* ([x (x)]
|
(let* ([x (x)]
|
||||||
[m (and (string? x) (regexp-match rx:secs+id x))]
|
[m (and (string? x) (regexp-match rx:secs+id x))]
|
||||||
[d (and m (seconds->date (string->number (cadr m))))])
|
[d (and m (seconds->date (string->number (cadr m))))]
|
||||||
|
[id (and m (substring (caddr m) 0 10))]
|
||||||
|
[how (and m (cadddr m))])
|
||||||
(define (pad02 f) (let ([n (f d)]) (if (< n 10) (format "0~a" n) n)))
|
(define (pad02 f) (let ([n (f d)]) (if (< n 10) (format "0~a" n) n)))
|
||||||
(and d (apply format "~a-~a-~a(~a/~a)"
|
(and d (format "~a-~a-~a(~a/~a)"
|
||||||
(date-year d) (pad02 date-month) (pad02 date-day)
|
(date-year d) (pad02 date-month) (pad02 date-day)
|
||||||
(cddr m)))))))
|
id how))))))
|
||||||
|
|
Loading…
Reference in New Issue
Block a user