aboutsummaryrefslogtreecommitdiffstats
path: root/gitto
diff options
context:
space:
mode:
Diffstat (limited to 'gitto')
-rw-r--r--gitto/main.scm11
1 files changed, 7 insertions, 4 deletions
diff --git a/gitto/main.scm b/gitto/main.scm
index ae1ce58..a076182 100644
--- a/gitto/main.scm
+++ b/gitto/main.scm
@@ -114,6 +114,11 @@ gitto [options]
(display "Not a registered repository."))
(newline))
+(define (format-repository name pushable pullable clean? updated)
+ (format
+ #t "~a:~15t~d to push, ~d to pull and is ~a. Last update: ~a\n"
+ name pushable pullable (if clean? "clean" "dirty") updated))
+
(define (git-revs-to-push)
"Check how many commits should be pushed upstream."
(let* ((pipe (open-input-pipe
@@ -159,10 +164,8 @@ to the tracked files. Utracked files will not register."
(numdown (git-revs-to-pull))
(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)))
+ (format-repository (basename repo) numup numdown clean?
+ lastupdate)))
(format #t "~a:~15tnot found at ~s\n" (basename repo) repo)))
repositories))