summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2025-01-17 04:47:47 -0600
committerJeff Carr <[email protected]>2025-01-17 04:47:47 -0600
commit0f232fe3428c812f0afc382085d51c42d7e6bbab (patch)
treec69af747fbbecc86d64dde34847b5b6fba74a98a
parent9e81be86dae1b6bf808bb087d50e464d35e9c7dd (diff)
more accurate repo Age()
-rw-r--r--Makefile1
-rw-r--r--humanTable.go30
2 files changed, 29 insertions, 2 deletions
diff --git a/Makefile b/Makefile
index d012f7a..8c3f608 100644
--- a/Makefile
+++ b/Makefile
@@ -22,6 +22,7 @@ goimports:
clean:
rm -f *.pb.go
-rm -f go.*
+ go-mod-clean --purge
forgeConfig.pb.go: forgeConfig.proto
autogenpb --proto forgeConfig.proto
diff --git a/humanTable.go b/humanTable.go
index bc6add5..0c0c62e 100644
--- a/humanTable.go
+++ b/humanTable.go
@@ -41,7 +41,31 @@ func (f *Forge) PrintHumanTable(allr *gitpb.Repos) {
all := allr.SortByFullPath()
for all.Scan() {
repo := all.Next()
- f.sendRepoToTable(repo)
+ f.printRepoToTable(repo)
+ count += 1
+ }
+ log.Info("Total git repositories:", count)
+}
+
+// also shows which files are dirty
+func (f *Forge) PrintHumanTableDirty(allr *gitpb.Repos) {
+ log.DaemonMode(true)
+
+ var count int
+ // log.Info(standardStart5("gopath", "cur name", "master", "user", "repo type"))
+ log.Info(standardTable8("repopath", "cur br", "age", "target", "master", "devel", "user", "curver", "repo type"))
+ all := allr.SortByFullPath()
+ for all.Scan() {
+ repo := all.Next()
+ f.printRepoToTable(repo)
+ if len(repo.DirtyList) != 0 {
+ for _, line := range repo.DirtyList {
+ log.Info("\t", line)
+ }
+ }
+ var mver string = repo.GetMasterVersion()
+ repo.Tags.GetAge(mver)
+
count += 1
}
log.Info("Total git repositories:", count)
@@ -133,7 +157,7 @@ func standardTable8(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9 string)
return fmt.Sprintf(s, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9)
}
-func (f *Forge) sendRepoToTable(repo *gitpb.Repo) {
+func (f *Forge) printRepoToTable(repo *gitpb.Repo) {
var end string
if repo.IsDirty() {
end += "(dirty) "
@@ -148,6 +172,8 @@ func (f *Forge) sendRepoToTable(repo *gitpb.Repo) {
var gopath string = repo.GetGoPath()
var rtype string = repo.GetRepoType()
+ // ctime := repo.Tags.GetAge(mhort)
+ // age := shell.FormatDuration(time.Since(ctime))
age := shell.FormatDuration(repo.NewestAge())
start := standardTable8(gopath, cname, age, thort, mhort, dhort, uhort, chort, rtype)