From c03d960f8475b184ea59f06fd64a143854e03ca9 Mon Sep 17 00:00:00 2001 From: Arun Isaac Date: Sun, 26 Sep 2021 23:30:16 +0530 Subject: gnbug: Merge creation-details into file-details. * gnbug (creation-details): Merge into ... (file-details): ... here. (issues): Do not call creation-details. --- gnbug | 33 ++++++++++++++++----------------- 1 file changed, 16 insertions(+), 17 deletions(-) diff --git a/gnbug b/gnbug index d7219fe..b79a118 100755 --- a/gnbug +++ b/gnbug @@ -70,16 +70,15 @@ even if it exits non-locally. Return the value returned by PROC." ;; avoid them. (sort (map (lambda (file) (let* ((file-details (file-details file)) - (creation-details (creation-details file)) (all-keywords (hashtable-ref file-details 'keywords '()))) (issue file ;; Fallback to filename if title has no alphabetic ;; characters. (let ((title (hashtable-ref file-details 'title ""))) (if (string-any char-set:letter title) title file)) - (assq-ref creation-details 'creator) - (assq-ref creation-details 'created-date) - (assq-ref creation-details 'created-relative-date) + (hashtable-ref file-details 'creator #f) + (hashtable-ref file-details 'created-date #f) + (hashtable-ref file-details 'created-relative-date #f) (hashtable-ref file-details 'assigned '()) ;; "closed" is a special keyword to indicate ;; the open/closed status of an issue. @@ -181,21 +180,21 @@ ports) in that it also supports DOS line endings." (const #t) get-line-dos-or-unix port))) + (call-with-input-pipe + (lambda (port) + (let ((alist (read port))) + (for-each (lambda (key) + (hashtable-set! result key (assq-ref alist key))) + (list 'creator 'created-date 'created-relative-date)))) + "git" "log" "--diff-filter=A" + (string-append "--format=format:(" + "(creator . \"%an\")" + "(created-date . %at)" + "(created-relative-date . \"%ar\")" + ")") + "--" file) result)) -(define (creation-details file) - "Return an association list of creation details about FILE extracted -from the git repository." - (call-with-input-pipe - read - "git" "log" "--diff-filter=A" - (string-append "--format=format:(" - "(creator . \"%an\")" - "(created-date . %at)" - "(created-relative-date . \"%ar\")" - ")") - "--" file)) - (define (git-updated-files transducer start-commit end-commit) "Use TRANSDUCER to transduce over the list of files updated between START-COMMIT and END-COMMIT." -- cgit v1.2.3