summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorArun Isaac2022-03-17 17:00:08 +0530
committerArun Isaac2022-03-18 16:24:01 +0530
commit15e9daaac9af2b2ed6dc34979dd43ab4e172bb72 (patch)
treefc7ea1637601cf20e35188a8b9856443931d2154 /bin
parent50898532c81654d834b1070b49d05c46e378a455 (diff)
downloadtissue-15e9daaac9af2b2ed6dc34979dd43ab4e172bb72.tar.gz
tissue-15e9daaac9af2b2ed6dc34979dd43ab4e172bb72.tar.lz
tissue-15e9daaac9af2b2ed6dc34979dd43ab4e172bb72.zip
issue: Record all commits affecting a file, not just how many.
* tissue/issue.scm (<post>): New record type. (file-details): Record all commits affecting a file, not just how many. * bin/tissue (print-issue, print-issue-to-gemtext): Apply length on the output of issue-posts before use. * tissue/web.scm (issue-list-item-markup-writer-action): Apply length on posts before use.
Diffstat (limited to 'bin')
-rwxr-xr-xbin/tissue146
1 files changed, 74 insertions, 72 deletions
diff --git a/bin/tissue b/bin/tissue
index 9273482..1293891 100755
--- a/bin/tissue
+++ b/bin/tissue
@@ -150,81 +150,83 @@ List recent updates.
(define (print-issue issue-number issue)
"Print ISSUE with number ISSUE-NUMBER."
- (display (magenta (issue-title issue)))
- ;; Highlight keywords containing "bug" or "critical" as whole words
- ;; in red. Else, highlight in blue.
- (unless (null? (issue-keywords issue))
- (display " ")
- (display (string-join
- (map (lambda (keyword)
- ((cond
- ((not (null? (lset-intersection
- string=?
- (string-split keyword #\space)
- (list "bug" "critical"))))
- red-background)
- (else blue-background))
- (string-append " " keyword " ")))
- (issue-keywords issue))
- " ")))
- (unless (null? (issue-assigned issue))
- (display (green (string-append " (assigned: "
- (string-join (issue-assigned issue)
- ", ")
- ")"))))
- (when (> (issue-posts issue) 1)
- (display (string-append " ["
- (number->string (issue-posts issue))
- " posts]")))
- (newline)
- (display (string-append
- (cyan (string-append "#" (number->string issue-number)))
- " opened "
- (cyan (issue-created-relative-date issue))
- " by "
- (cyan (issue-creator issue))))
- (when (> (issue-posts issue) 1)
- (display (string-append (cyan ",")
- " last updated "
- (cyan (issue-last-updated-relative-date issue))
- " by "
- (cyan (issue-last-updater issue)))))
- (unless (zero? (issue-tasks issue))
- (display (string-append (cyan "; ")
- (number->string (issue-completed-tasks issue))
- "/"
- (number->string (issue-tasks issue))
- " tasks done")))
- (newline))
+ (let ((number-of-posts (length (issue-posts issue))))
+ (display (magenta (issue-title issue)))
+ ;; Highlight keywords containing "bug" or "critical" as whole
+ ;; words in red. Else, highlight in blue.
+ (unless (null? (issue-keywords issue))
+ (display " ")
+ (display (string-join
+ (map (lambda (keyword)
+ ((cond
+ ((not (null? (lset-intersection
+ string=?
+ (string-split keyword #\space)
+ (list "bug" "critical"))))
+ red-background)
+ (else blue-background))
+ (string-append " " keyword " ")))
+ (issue-keywords issue))
+ " ")))
+ (unless (null? (issue-assigned issue))
+ (display (green (string-append " (assigned: "
+ (string-join (issue-assigned issue)
+ ", ")
+ ")"))))
+ (when (> number-of-posts 1)
+ (display (string-append " ["
+ (number->string number-of-posts)
+ " posts]")))
+ (newline)
+ (display (string-append
+ (cyan (string-append "#" (number->string issue-number)))
+ " opened "
+ (cyan (issue-created-relative-date issue))
+ " by "
+ (cyan (issue-creator issue))))
+ (when (> number-of-posts 1)
+ (display (string-append (cyan ",")
+ " last updated "
+ (cyan (issue-last-updated-relative-date issue))
+ " by "
+ (cyan (issue-last-updater issue)))))
+ (unless (zero? (issue-tasks issue))
+ (display (string-append (cyan "; ")
+ (number->string (issue-completed-tasks issue))
+ "/"
+ (number->string (issue-tasks issue))
+ " tasks done")))
+ (newline)))
(define (print-issue-to-gemtext issue-number issue)
"Print ISSUE with number ISSUE-NUMBER to gemtext."
- (format #t "# ~a" (issue-title issue))
- (unless (null? (issue-keywords issue))
- (format #t " [~a]"
- (string-join (issue-keywords issue)
- ", ")))
- (unless (null? (issue-assigned issue))
- (format #t " (assigned: ~a)"
- (string-join (issue-assigned issue)
- ", ")))
- (when (> (issue-posts issue) 1)
- (format #t " [~a posts]" (issue-posts issue)))
- (newline)
- (format #t "~a opened ~a by ~a"
- issue-number
- (issue-created-relative-date issue)
- (issue-creator issue))
- (when (> (issue-posts issue) 1)
- (format #t ", last updated ~a by ~a"
- (issue-last-updated-relative-date issue)
- (issue-last-updater issue)))
- (unless (zero? (issue-tasks issue))
- (format #t "; ~a/~a tasks done"
- (issue-completed-tasks issue)
- (issue-tasks issue)))
- (newline)
- (newline))
+ (let ((number-of-posts (length (issue-posts issue))))
+ (format #t "# ~a" (issue-title issue))
+ (unless (null? (issue-keywords issue))
+ (format #t " [~a]"
+ (string-join (issue-keywords issue)
+ ", ")))
+ (unless (null? (issue-assigned issue))
+ (format #t " (assigned: ~a)"
+ (string-join (issue-assigned issue)
+ ", ")))
+ (when (> number-of-posts 1)
+ (format #t " [~a posts]" number-of-posts))
+ (newline)
+ (format #t "~a opened ~a by ~a"
+ issue-number
+ (issue-created-relative-date issue)
+ (issue-creator issue))
+ (when (> number-of-posts 1)
+ (format #t ", last updated ~a by ~a"
+ (issue-last-updated-relative-date issue)
+ (issue-last-updater issue)))
+ (unless (zero? (issue-tasks issue))
+ (format #t "; ~a/~a tasks done"
+ (issue-completed-tasks issue)
+ (issue-tasks issue)))
+ (newline)
+ (newline)))
(define tissue-list
(match-lambda*