general usefulness

This commit is contained in:
Jeff Carr 2025-01-28 21:15:24 -06:00
parent bb7937bb79
commit eee88af0ce
7 changed files with 24 additions and 32 deletions

View File

@ -100,7 +100,6 @@ 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"`

View File

@ -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":

View File

@ -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)))
}

View File

@ -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,6 +37,7 @@ func doVerifyDevel() error {
}
// devel branch is only local
/*
todo: something?
devname := repo.GetDevelBranchName()
if err := requiresGitPush(repo, devname); err != nil {
log.Info(repo.GetGoPath(), "is out of sync with upstream")

View File

@ -17,11 +17,6 @@ func (f *FindCmd) findRepos() {
return
}
if argv.List.Patches != nil {
findReposWithPatches()
return
}
if f.All {
findAll()
return

View File

@ -159,6 +159,11 @@ func main() {
log.Info(i, line)
}
}
if argv.Patch.Show != nil {
findReposWithPatches()
me.forge.PrintHumanTable(me.found)
}
okExit("patch list")
}

View File

@ -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"