diff options
| author | Jeff Carr <[email protected]> | 2025-11-03 06:49:58 -0600 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2025-11-03 06:49:58 -0600 |
| commit | 5849f18a91fd7877ad5fb8165b29a3df8c5f3ed1 (patch) | |
| tree | 798519fc048713675cab470fe6d1fcdf92dc6097 /doShow.go | |
| parent | fbd8440780da37e6e4cc94a7713b7815e85ad2e4 (diff) | |
show remote refs table
Diffstat (limited to 'doShow.go')
| -rw-r--r-- | doShow.go | 32 |
1 files changed, 29 insertions, 3 deletions
@@ -3,7 +3,12 @@ package main -import "go.wit.com/lib/env" +import ( + "errors" + + "go.wit.com/lib/env" + "go.wit.com/log" +) func doShow() (string, error) { if argv.Show.Dirty != nil { @@ -26,6 +31,27 @@ func doShow() (string, error) { return s, err } + if argv.Show.Repo != "" { + r := me.forge.Repos.FindByNamespace(argv.Show.Repo) + if r == nil { + return "no repo " + argv.Show.Repo, errors.New("no repo " + argv.Show.Repo) + } + for _, rmote := range r.Config.Remotes { + stats, err := r.LoadRemoteRefs(rmote.Name) + if err != nil { + // return err + } + if env.True("resort") { + stats.SaveByHash() + log.Info("stats should have been resorted and saved") + } else { + footer := stats.PrintTable() + log.Info("full remote refs footer:", footer) + } + } + return "remote refs table", nil + } + found := findRepos() if showUrls() { found.SortNamespace() @@ -42,10 +68,10 @@ func showUrls() bool { if argv.Show == nil { return false } - if argv.Show.Repo == nil { + if argv.Show.Repos == nil { return false } - if argv.Show.Repo.Urls != nil { + if argv.Show.Repos.Urls != nil { return true } return false |
