From 4ca7a5ae2f80b41bf6ef8aecbcb5325bc788d968 Mon Sep 17 00:00:00 2001 From: Arun Isaac Date: Fri, 18 Mar 2022 16:21:17 +0530 Subject: issue: Add authors function returning all authors. * tissue/issue.scm (authors): New public function. --- tissue/issue.scm | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/tissue/issue.scm b/tissue/issue.scm index 8d1d11c..91585a7 100644 --- a/tissue/issue.scm +++ b/tissue/issue.scm @@ -48,6 +48,7 @@ post-author post-date post-relative-date + authors issues)) (define %aliases @@ -132,6 +133,21 @@ return #f." (time-monotonic->date (make-time time-monotonic 0 timestamp))) +(define authors + (memoize-thunk + (lambda () + "Return a list of all authors who have committed to this git +repository." + (delete-duplicates + (map (cut resolve-alias <> (%aliases)) + (call-with-input-pipe + (lambda (port) + (port-transduce (tmap (lambda (line) + (match (string-split line #\tab) + ((_ author) author)))) + rcons get-line port)) + "git" "shortlog" "--summary")))))) + (define (resolve-alias name aliases) "Resolve NAME against ALIASES, a list of aliases. ALIASES should be in the form of the argument of the same name to `tissue-configuration' -- cgit v1.2.3