From 1eac3e1d280d9ee083ea1a1ea822372ac91fba8b Mon Sep 17 00:00:00 2001 From: Eli Barzilay Date: Sun, 25 Jul 2010 03:43:36 -0400 Subject: [PATCH] Show only first 10-character prefix of the sha1. --- collects/repo-time-stamp/stamp.rkt | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/collects/repo-time-stamp/stamp.rkt b/collects/repo-time-stamp/stamp.rkt index e71cedc568..726d99d50e 100644 --- a/collects/repo-time-stamp/stamp.rkt +++ b/collects/repo-time-stamp/stamp.rkt @@ -34,8 +34,10 @@ (file-or-directory-modify-seconds this-file))))]) (let* ([x (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))) - (and d (apply format "~a-~a-~a(~a/~a)" - (date-year d) (pad02 date-month) (pad02 date-day) - (cddr m))))))) + (and d (format "~a-~a-~a(~a/~a)" + (date-year d) (pad02 date-month) (pad02 date-day) + id how))))))