summaryrefslogtreecommitdiff
path: root/gnbug
diff options
context:
space:
mode:
authorArun Isaac2021-09-26 23:30:16 +0530
committerArun Isaac2021-09-26 23:30:16 +0530
commitc03d960f8475b184ea59f06fd64a143854e03ca9 (patch)
tree07bf6e09d2c4a6496bb666253fbc65028756f5b9 /gnbug
parent0fc8d16049dad035d58d37d71561976b5434babb (diff)
downloadgn-gemtext-c03d960f8475b184ea59f06fd64a143854e03ca9.tar.gz
gnbug: Merge creation-details into file-details.
* gnbug (creation-details): Merge into ... (file-details): ... here. (issues): Do not call creation-details.
Diffstat (limited to 'gnbug')
-rwxr-xr-xgnbug33
1 files 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."