Replaced commit list in browse-git.
authorTim Vaughan <tgvaughan@gmail.com>
Tue, 18 Jun 2019 09:00:59 +0000 (11:00 +0200)
committerTim Vaughan <tgvaughan@gmail.com>
Tue, 18 Jun 2019 09:00:59 +0000 (11:00 +0200)
examples/browse-git.scm [changed mode: 0755->0644]

old mode 100755 (executable)
new mode 100644 (file)
index dbf0b17..ec7ea42
@@ -40,7 +40,8 @@
 
     (define (serve-tree)
       (let ((entries (git "ls-tree" branch path))
-            (references (git "show-ref" "--heads")))
+            (references (git "show-ref" "--heads"))
+            (commits (git "rev-list" "--abbrev-commit" "-n5" branch)))
         (append
          (list (conc "Git repository " git-base-url repo)
                "")
                          refname)
                    (conc "browse-git.scm|" repo "|" refname "|" path "|tree"))))
               references)
+         (list
+          ""
+          (conc "-----= Recent Commits [" branch "] =-----"))
+         (map (lambda (commit)
+                (list
+                 1
+                 (conc (if (equal? branch commit) "*" "")
+                       (car (git "show" "-s" "--format=%s (%ar)" commit)))
+                 (conc "browse-git.scm|" repo "|" commit "|" path "|tree")))
+              commits)
          (list ""
                (conc "-----= Files [" path "] =-----"))
          (map (lambda (entry)