- (define (serve-tree)
- (let ((entries (git "ls-tree" branch path))
- (references (git "show-ref" "--heads")))
- (append
- (list
- (conc "Git repository " repo)
- ""
- (conc "(Clone from " git-base-url repo ".)")
- ""
- "-----= Branches =-----")
- (map (lambda (ref)
- (let ((refname (caddr (string-split ref "/"))))
+ (define (serve-tree)
+ (let ((entries (git "ls-tree" branch path))
+ (references (git "show-ref" "--heads"))
+ (commits (git "rev-list" "--abbrev-commit" "-n5" branch)))
+ (append
+ (list (conc "Git repository " git-base-url repo)
+ "")
+ (let ((descr-file (make-pathname git-base-dir
+ (make-pathname repo "project-description"))))
+ (if (file-exists? descr-file)
+ (list "----= Description =----"
+ (with-input-from-file descr-file read-string)
+ "")
+ '()))
+ (list "-----= Branches =-----")
+ (map (lambda (ref)
+ (let ((refname (caddr (string-split ref "/"))))
+ (list
+ 1
+ (conc (if (equal? branch refname) "*" "")
+ refname)
+ (conc "browse-git.scm|" repo "|" refname "|" path "|tree"))))
+ references)
+ (list
+ ""
+ (conc "-----= Recent Commits [" branch "] =-----"))
+ (map (lambda (commit)