Skip to content

Commit

Permalink
Add Last update to normal output
Browse files Browse the repository at this point in the history
When viewing the status of your repositories you will now see also
when your last update to the upstream branch was. If you have not
fetched or pulled the latest changes from your upstream, this will not
be accurate.
  • Loading branch information
ryuslash committed Jul 1, 2012
1 parent 4bcea92 commit 58dcd2f
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions gitto/main.scm
Expand Up @@ -91,16 +91,23 @@ gitto [options]
(close-pipe pipe)
clean?))

(define (git-last-update)
(let* ((pipe (open-input-pipe "git log -1 --format=%ar @{u}"))
(relative-last-update (read-line pipe)))
(close-pipe pipe)
relative-last-update))

(define (list-repositories)
(for-each
(lambda (repo)
(chdir repo)
(let ((numup (git-revs-to-push))
(numdown (git-revs-to-pull))
(clean? (git-clean?)))
(format #t "~a:~15t~d to push, ~d to pull and is ~adirty.\n"
(basename repo) numup numdown
(if clean? "not " ""))))
(clean? (git-clean?))
(lastupdate (git-last-update)))
(format #t
"~a:~15t~d to push, ~d to pull and is ~adirty. Last update: ~a\n"
(basename repo) numup numdown (if clean? "not " "") lastupdate)))
repositories))

(define (list-repository-locations)
Expand Down

0 comments on commit 58dcd2f

Please sign in to comment.