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.
This commit is contained in:
parent
4bcea9254e
commit
58dcd2fa57
1 changed files with 11 additions and 4 deletions
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue