summary refs log tree commit diff
diff options
context:
space:
mode:
authorArun Isaac2022-07-09 15:38:07 +0530
committerArun Isaac2022-07-09 16:41:02 +0530
commitfcbd627e9a4fe936485bcb080669d72b5b60324d (patch)
tree097aa4aba7bf16a8bf8fb930733c9cc0e6b49b1e
parentb0cf99385a73b7461789aae2d71f7ad23ab5c56f (diff)
downloadtissue-fcbd627e9a4fe936485bcb080669d72b5b60324d.tar.gz
tissue-fcbd627e9a4fe936485bcb080669d72b5b60324d.tar.lz
tissue-fcbd627e9a4fe936485bcb080669d72b5b60324d.zip
git: Use commit author date, not committer date.
* tissue/git.scm (commit-author-date): New public function.
(commit-date): Delete function.
* tissue/issue.scm (read-gemtext-issue): Use commit-author-date
instead of commit-date.
-rw-r--r--tissue/git.scm16
-rw-r--r--tissue/issue.scm6
2 files changed, 12 insertions, 10 deletions
diff --git a/tissue/git.scm b/tissue/git.scm
index 024ebb6..1f6c0ef 100644
--- a/tissue/git.scm
+++ b/tissue/git.scm
@@ -41,7 +41,7 @@
             git-top-level
             %current-git-repository
             current-git-repository
-            commit-date
+            commit-author-date
             git-tracked-files
             call-with-file-in-git
             file-modification-table
@@ -99,12 +99,14 @@ directory."
    (commit-lookup repository
                   (reference-name->oid repository "HEAD"))))
 
-(define (commit-date commit)
-  (time-monotonic->date
-   (make-time time-monotonic
-              0
-              (commit-time commit))
-   (* 60 (commit-time-offset commit))))
+(define (commit-author-date commit)
+  "Return the author date of COMMIT as an SRFI-19 date object."
+  (let ((time (signature-when (commit-author commit))))
+    (time-monotonic->date
+     (make-time time-monotonic
+                0
+                (time-time time))
+     (* 60 (time-offset time)))))
 
 (define* (git-tracked-files #:optional (repository (current-git-repository)))
   "Return a list of all files and directories tracked in REPOSITORY. The
diff --git a/tissue/issue.scm b/tissue/issue.scm
index a77e57a..ac397b4 100644
--- a/tissue/issue.scm
+++ b/tissue/issue.scm
@@ -382,9 +382,9 @@ gemtext file."
       #:title (let ((title (hashtable-ref file-details 'title "")))
                 (if (string-any char-set:letter title) title file))
       #:creator (first commit-authors)
-      #:created-date (commit-date (first commits))
+      #:created-date (commit-author-date (first commits))
       #:last-updater (last commit-authors)
-      #:last-updated-date (commit-date (last commits))
+      #:last-updated-date (commit-author-date (last commits))
       #:assigned (hashtable-ref file-details 'assigned '())
       ;; "closed" is a special keyword to indicate the open/closed
       ;; status of an issue.
@@ -395,6 +395,6 @@ gemtext file."
       #:posts (map (lambda (commit author)
                      (make <post>
                        #:author author
-                       #:date (commit-date commit)))
+                       #:date (commit-author-date commit)))
                    commits
                    commit-authors))))