summaryrefslogtreecommitdiff
path: root/scan.go
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2024-02-23 14:25:00 -0600
committerJeff Carr <[email protected]>2024-02-23 14:25:00 -0600
commitab7c8717a3dc6d88bffb6faecbc583e7d628d310 (patch)
treeb40f1572e0ff11cde4b02c7286955c20530dfa71 /scan.go
parentdb83cb7fb9caa951e643d32cf475504082fed641 (diff)
report count of the changes
Diffstat (limited to 'scan.go')
-rw-r--r--scan.go14
1 files changed, 9 insertions, 5 deletions
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
}