diff options
author | Arun Isaac | 2021-09-27 00:14:25 +0530 |
---|---|---|
committer | Arun Isaac | 2021-09-27 00:14:25 +0530 |
commit | 6cdb87d430deecffca078f2cbb1cc41e85f37f10 (patch) | |
tree | 4ff73692ecdd0509d04454f8acb52aa083d62d29 | |
parent | 8f6d83833df3380fa9d2ed58ce31afa92342fcf9 (diff) | |
download | gn-gemtext-6cdb87d430deecffca078f2cbb1cc41e85f37f10.tar.gz |
gnbug: Extract last update information.
* gnbug (file-details): Extract last update information.
(<issue>): Add last-updater, last-updated-date and
last-updated-relative-date fields.
(issues): Initialize last-updater, last-updated-date and
last-updated-relative-date fields.
-rwxr-xr-x | gnbug | 32 |
1 files changed, 24 insertions, 8 deletions
@@ -50,6 +50,7 @@ even if it exits non-locally. Return the value returned by PROC." (define-record-type <issue> (issue file title creator created-date created-relative-date + last-updater last-updated-date last-updated-relative-date assigned keywords open tasks completed-tasks posts) issue? (file issue-file) @@ -57,6 +58,9 @@ even if it exits non-locally. Return the value returned by PROC." (creator issue-creator) (created-date issue-created-date) (created-relative-date issue-created-relative-date) + (last-updater issue-last-updater) + (last-updated-date issue-last-updated-date) + (last-updated-relative-date issue-last-updated-relative-date) (assigned issue-assigned) (keywords issue-keywords) (open issue-open) @@ -80,6 +84,9 @@ even if it exits non-locally. Return the value returned by PROC." (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 'last-updater #f) + (hashtable-ref file-details 'last-updated-date #f) + (hashtable-ref file-details 'last-updated-relative-date #f) (hashtable-ref file-details 'assigned '()) ;; "closed" is a special keyword to indicate ;; the open/closed status of an issue. @@ -187,14 +194,23 @@ ports) in that it also supports DOS line endings." (hashtable-set! result 'posts (port-transduce - (tmap (lambda (line) - (let ((alist (call-with-input-string line read))) - (hashtable-set! result 'creator - (assq-ref alist 'author)) - (hashtable-set! result 'created-date - (assq-ref alist 'author-date)) - (hashtable-set! result 'created-relative-date - (assq-ref alist 'author-relative-date))))) + (compose (tenumerate) + (tmap (match-lambda + ((index . line) + (let ((alist (call-with-input-string line read))) + (when (zero? index) + (hashtable-set! result 'last-updater + (assq-ref alist 'author)) + (hashtable-set! result 'last-updated-date + (assq-ref alist 'author-date)) + (hashtable-set! result 'last-updated-relative-date + (assq-ref alist 'author-relative-date))) + (hashtable-set! result 'creator + (assq-ref alist 'author)) + (hashtable-set! result 'created-date + (assq-ref alist 'author-date)) + (hashtable-set! result 'created-relative-date + (assq-ref alist 'author-relative-date))))))) rcount get-line port))) "git" "log" (string-append "--format=format:(" |