diff options
author | Tom Willemsen | 2012-07-01 20:03:59 +0200 |
---|---|---|
committer | Tom Willemsen | 2012-07-01 20:03:59 +0200 |
commit | 58dcd2fa572163b6f2e39f5e5712273b19256327 (patch) | |
tree | 4a720a3c2369cce282d74a9c260367bf2c05f17e /gitto | |
parent | 4bcea9254e820e09fddfcf24fd763162adac7147 (diff) | |
download | gitto-58dcd2fa572163b6f2e39f5e5712273b19256327.tar.gz gitto-58dcd2fa572163b6f2e39f5e5712273b19256327.zip |
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.
Diffstat (limited to 'gitto')
-rw-r--r-- | gitto/main.scm | 15 |
1 files 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) |