From ab7c8717a3dc6d88bffb6faecbc583e7d628d310 Mon Sep 17 00:00:00 2001 From: Jeff Carr Date: Fri, 23 Feb 2024 14:25:00 -0600 Subject: report count of the changes --- scan.go | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'scan.go') diff --git a/scan.go b/scan.go index f2e80ea..faf176a 100644 --- a/scan.go +++ b/scan.go @@ -19,10 +19,12 @@ func (r *RepoList) RegisterHideFunction(f func(*RepoRow)) { func (r *RepoList) ScanRepositories() (int, string) { var i int var shown int + var total int t := TimeFunction(func() { for _, repo := range me.allrepos { i += 1 - repo.NewScan() + changed := repo.NewScan() + total += changed if me.hideFunction == nil { // application didn't register a hide function } else { @@ -44,14 +46,15 @@ func (r *RepoList) ScanRepositories() (int, string) { me.shownCount.SetText(tmp) me.duration.SetText(s) - log.Info("Scanned", i, "repositories. todo: count/show changes in", s) + log.Info("Scanned", i, "repositories.", total, "changes in", s) return i, s } -func (r *RepoRow) NewScan() bool { +func (r *RepoRow) NewScan() int { + var changed int = 0 if r.Status == nil { log.Warn("repo.Status = nil. not initialized for some reason") - return false + return changed } // run the repostatus update @@ -62,6 +65,7 @@ func (r *RepoRow) NewScan() bool { c := strings.TrimSpace(c) for _, line := range strings.Split(c, "\n") { log.Info(r.Status.Path(), line) + changed += 1 } } @@ -73,5 +77,5 @@ func (r *RepoRow) NewScan() bool { r.Show() } } - return true + return changed } -- cgit v1.2.3