From 58dcd2fa572163b6f2e39f5e5712273b19256327 Mon Sep 17 00:00:00 2001 From: Tom Willemsen Date: Sun, 1 Jul 2012 20:03:59 +0200 Subject: Add Last update to normal output 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. --- gitto/main.scm | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/gitto/main.scm b/gitto/main.scm index cd54787..604142d 100644 --- a/gitto/main.scm +++ b/gitto/main.scm @@ -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) -- cgit v1.2.3-54-g00ecf