diff options
| author | Jeff Carr <[email protected]> | 2025-10-10 04:15:02 -0500 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2025-10-10 04:15:02 -0500 |
| commit | 0cfcc140f9d272c1b5eb620e05eaa4362909e8db (patch) | |
| tree | dce9affe4580bfee1aefedf9a390b8dbffaa119c | |
| parent | 0996047c5e8757c5fd034b1aa07156dd6471c292 (diff) | |
make a file for these
| -rw-r--r-- | doShow.go | 53 | ||||
| -rw-r--r-- | main.go | 35 |
2 files changed, 53 insertions, 35 deletions
diff --git a/doShow.go b/doShow.go new file mode 100644 index 0000000..3d2a1b3 --- /dev/null +++ b/doShow.go @@ -0,0 +1,53 @@ +// Copyright 2017-2025 WIT.COM Inc. All rights reserved. +// Use of this source code is governed by the GPL 3.0 + +package main + +import "go.wit.com/log" + +// An app to submit patches for the 30 GO GUI repos + +func doShow() (string, error) { + if argv.Show.Dirty != nil { + // s, err := doDirty() + _, s, err := getDirty() + me.forge.Repos.Save() + return s, err + } + + if argv.Show.Porcelain != nil { + s, err := getPorcelain() + for repo := range me.forge.Repos.IterByFullPath() { + curbranch := repo.GetCurrentBranchName() + if repo.IsLocalBranch(curbranch) { + continue + } + if repo.IsRemoteBranch(curbranch) { + continue + } + log.Info("curbranch is doesn't exist. this'll cause all sorts of problems", curbranch, repo.FullPath) + } + me.forge.Repos.Save() + return s, err + } + + if argv.Show.Tag != nil { + doTag() + return "tags shown", nil + } + + found := findRepos() + if showUrls() { + found.SortNamespace() + footer := me.forge.PrintForgedTable(found) + return "repos with patches or unsaved changes: " + footer, nil + } + var footer string + // print out the repos + if argv.All { + footer = me.forge.PrintHumanTableFull(found) + } else { + footer = me.forge.PrintDefaultTB(found) + } + return footer, nil +} @@ -186,38 +186,3 @@ func doDefaultBehavior() (string, error) { footer := me.forge.PrintDefaultTB(found) return footer, nil } - -func doShow() (string, error) { - if argv.Show.Dirty != nil { - // s, err := doDirty() - _, s, err := getDirty() - me.forge.Repos.Save() - return s, err - } - - if argv.Show.Porcelain != nil { - s, err := getPorcelain() - me.forge.Repos.Save() - return s, err - } - - if argv.Show.Tag != nil { - doTag() - return "tags shown", nil - } - - found := findRepos() - if showUrls() { - found.SortNamespace() - footer := me.forge.PrintForgedTable(found) - return "repos with patches or unsaved changes: " + footer, nil - } - var footer string - // print out the repos - if argv.All { - footer = me.forge.PrintHumanTableFull(found) - } else { - footer = me.forge.PrintDefaultTB(found) - } - return footer, nil -} |
