diff options
| author | Jeff Carr <[email protected]> | 2025-01-28 21:15:24 -0600 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2025-01-29 12:18:16 -0600 |
| commit | eee88af0ce0afd82046985572d2bea0090c7e087 (patch) | |
| tree | 95a1955604a9609f1c67e503ea43d21700d2dc25 | |
| parent | bb7937bb792919e37a1bd94acd8a54f5824f7a50 (diff) | |
general usefulness
| -rw-r--r-- | argv.go | 13 | ||||
| -rw-r--r-- | argvAutoshell.go | 6 | ||||
| -rw-r--r-- | doPull.go | 2 | ||||
| -rw-r--r-- | doVerifyDevel.go | 18 | ||||
| -rw-r--r-- | find.go | 5 | ||||
| -rw-r--r-- | main.go | 5 | ||||
| -rw-r--r-- | resources/forge.text | 7 |
7 files changed, 24 insertions, 32 deletions
@@ -100,13 +100,12 @@ type DirtyCmd struct { } type FindCmd struct { - Patches *EmptyCmd `arg:"subcommand:patches" help:"show repos that have patches"` - All bool `arg:"--all" help:"select every repo (the default)"` - Mine bool `arg:"--mine" help:"your repos as defined in the forge config"` - Favorites bool `arg:"--favorites" help:"your repos configured as favorites"` - Private bool `arg:"--private" help:"your private repos from your .config/forge/"` - Dirty bool `arg:"--dirty" help:"only use dirty git repos"` - User bool `arg:"--user" help:"show repos on the user branch"` + All bool `arg:"--all" help:"select every repo (the default)"` + Mine bool `arg:"--mine" help:"your repos as defined in the forge config"` + Favorites bool `arg:"--favorites" help:"your repos configured as favorites"` + Private bool `arg:"--private" help:"your private repos from your .config/forge/"` + Dirty bool `arg:"--dirty" help:"only use dirty git repos"` + User bool `arg:"--user" help:"show repos on the user branch"` // ReadOnly bool `arg:"--readonly" help:"include read-only repos"` } diff --git a/argvAutoshell.go b/argvAutoshell.go index e54738a..caef069 100644 --- a/argvAutoshell.go +++ b/argvAutoshell.go @@ -3,7 +3,6 @@ package main import ( "fmt" "os" - "os/user" ) /* @@ -22,8 +21,7 @@ func (args) doBashAuto() { argv.doBashHelp() switch argv.BashAuto[0] { case "checkout": - usr, _ := user.Current() - fmt.Println("user devel master " + usr.Username) + fmt.Println("user devel master ") case "clean": // me.pp.WriteHelp(os.Stderr) // me.pp.WriteUsageForSubcommand(os.Stderr, me.pp.SubcommandNames()...) @@ -41,7 +39,7 @@ func (args) doBashAuto() { case "examine": fmt.Println("fix") case "list": - fmt.Println("--all --mine --favorites --private patches") + fmt.Println("--all --mine --favorites --private") case "pull": fmt.Println("--verbose") case "patch": @@ -14,7 +14,7 @@ func rillPull(repo *gitpb.Repo) error { return nil } t, _ := repo.LastGitPull() - if time.Since(t) < time.Hour { + if time.Since(t) < time.Minute*10 { if argv.Verbose { log.Info(repo.GetFullPath(), "git pulled too recently", shell.FormatDuration(time.Since(t))) } diff --git a/doVerifyDevel.go b/doVerifyDevel.go index b8fd419..f002553 100644 --- a/doVerifyDevel.go +++ b/doVerifyDevel.go @@ -1,8 +1,6 @@ package main import ( - "path/filepath" - "go.wit.com/lib/protobuf/gitpb" "go.wit.com/log" ) @@ -24,14 +22,13 @@ func doVerifyDevel() error { continue } - // check if devel branch exists in remote repo devel := repo.GetDevelBranchName() if argv.Verbose { log.Printf("Start clean devel branch: %s %s\n", repo.GetGoPath(), devel) } - if repo.Exists(filepath.Join(".git/refs/remotes/origin", devel)) { - // todo: actually use .git/config + // check if devel branch exists in remote repo + if repo.IsBranchRemote(devel) { if err := doCleanDevelRepo(repo); err != nil { log.Info(repo.GetGoPath(), "verify clean failed") } @@ -40,11 +37,12 @@ func doVerifyDevel() error { } // devel branch is only local /* - devname := repo.GetDevelBranchName() - if err := requiresGitPush(repo, devname); err != nil { - log.Info(repo.GetGoPath(), "is out of sync with upstream") - return err - } + todo: something? + devname := repo.GetDevelBranchName() + if err := requiresGitPush(repo, devname); err != nil { + log.Info(repo.GetGoPath(), "is out of sync with upstream") + return err + } */ } return nil @@ -17,11 +17,6 @@ func (f *FindCmd) findRepos() { return } - if argv.List.Patches != nil { - findReposWithPatches() - return - } - if f.All { findAll() return @@ -159,6 +159,11 @@ func main() { log.Info(i, line) } } + if argv.Patch.Show != nil { + findReposWithPatches() + me.forge.PrintHumanTable(me.found) + + } okExit("patch list") } diff --git a/resources/forge.text b/resources/forge.text index 3ad9842..947b5fb 100644 --- a/resources/forge.text +++ b/resources/forge.text @@ -1,10 +1,7 @@ -# this file is automatically re-generated from forge.pb, however, -# if you want to edit it by hand, you can: -# stop forge; remove forge.pb; edit forge.text; start forge -# this will cause the default behavior to fallback to parsing this file for the config - # this file is intended to be used to customize settings on what # git repos you have write access to. That is, where you can run 'git push' +# +# add entries to this using 'forge config' ForgeConfigs: { goPath: "go.wit.com" |
