summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArun Isaac2022-03-18 16:21:17 +0530
committerArun Isaac2022-03-18 16:24:49 +0530
commit4ca7a5ae2f80b41bf6ef8aecbcb5325bc788d968 (patch)
tree50aeff776d2c2627eb04b224791dfa78048d279b
parentf7fe6f27ea67901ee51ec91c9fdd40fcd13e8d4b (diff)
downloadtissue-4ca7a5ae2f80b41bf6ef8aecbcb5325bc788d968.tar.gz
tissue-4ca7a5ae2f80b41bf6ef8aecbcb5325bc788d968.tar.lz
tissue-4ca7a5ae2f80b41bf6ef8aecbcb5325bc788d968.zip
issue: Add authors function returning all authors.
* tissue/issue.scm (authors): New public function.
-rw-r--r--tissue/issue.scm16
1 files changed, 16 insertions, 0 deletions
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'