diff options
| author | Jeff Carr <[email protected]> | 2024-12-17 01:34:52 -0600 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2024-12-17 01:34:52 -0600 |
| commit | 17421bd22f0277503fe3a9911f26f1d80e663ad1 (patch) | |
| tree | dbc4551c3c80bc9beeddcbb4a92ce16bee860947 | |
| parent | c72040a9fb2eae45eb2c3230e148afe302f23ba2 (diff) | |
trash old and no longer working test code
| -rw-r--r-- | .gitignore | 1 | ||||
| -rw-r--r-- | Makefile | 2 | ||||
| -rw-r--r-- | going2git/Makefile | 28 | ||||
| -rw-r--r-- | going2git/message.go | 23 | ||||
| -rw-r--r-- | scanGoSrc/Makefile | 25 | ||||
| -rw-r--r-- | scanGoSrc/argv.go | 50 | ||||
| -rw-r--r-- | scanGoSrc/main.go | 54 | ||||
| -rw-r--r-- | validate/Makefile | 21 | ||||
| -rw-r--r-- | validate/argv.go | 42 | ||||
| -rw-r--r-- | validate/main.go | 97 |
10 files changed, 52 insertions, 291 deletions
@@ -13,3 +13,4 @@ testGui/testGui go-clone-test/go-clone-test go-clone-test/goclonetest go-clone-test/goclonetesttest +going2git/going2git @@ -1,7 +1,5 @@ all: make -C forgeConfig - make -C scanGoSrc - make -C validate make -C virtbuf-example make -C zoopb-example make -C testGui diff --git a/going2git/Makefile b/going2git/Makefile new file mode 100644 index 0000000..1e8c9f8 --- /dev/null +++ b/going2git/Makefile @@ -0,0 +1,28 @@ +VERSION = $(shell git describe --tags) +GUIVERSION = $(shell git describe --tags) +BUILDTIME = $(shell date +%s) + +all: build + +build: goimports + GO111MODULE=off go build \ + -ldflags "-X main.VERSION=${VERSION} -X main.BUILDTIME=${BUILDTIME} -X gui.GUIVERSION=${VERSION}" + +vet: + GO111MODULE=off go vet + +goimports: + goimports -w *.go + # // to globally reset paths: + # // gofmt -w -r '"go.wit.com/gui/gadgets" -> "go.wit.com/lib/gadgets"' *.go + +gocui: build + reset + ./go-clone-test --gui gocui + +install: goimports + GO111MODULE=off go install \ + -ldflags "-X main.VERSION=${VERSION} -X main.BUILDTIME=${BUILDTIME} -X gui.GUIVERSION=${VERSION}" + +force: build + ./go-clone-test --force diff --git a/going2git/message.go b/going2git/message.go new file mode 100644 index 0000000..f2bc2ba --- /dev/null +++ b/going2git/message.go @@ -0,0 +1,23 @@ +package main + +import ( + "fmt" + + git "go.wit.com/lib/git2go" + "go.wit.com/log" +) + +func main() { + var input git.Trailer + + input.Key = "Co-authored-by" + input.Value = "Alice <[email protected]>" + /* + git2go.Trailer + git2go.Trailer{Key: "Signed-off-by", Value: "Bob <[email protected]>"}} + */ + + fmt.Printf("%s", input) + actual, err := git.MessageTrailers(input.Key) + log.Info("actual", actual, err) +} diff --git a/scanGoSrc/Makefile b/scanGoSrc/Makefile deleted file mode 100644 index eeaa73f..0000000 --- a/scanGoSrc/Makefile +++ /dev/null @@ -1,25 +0,0 @@ -VERSION = $(shell git describe --tags) -BUILDTIME = $(shell date +%Y.%m.%d) - -build: - GO111MODULE=off go build \ - -ldflags "-X main.VERSION=${VERSION} -X main.BUILDTIME=${BUILDTIME} -X gui.GUIVERSION=${VERSION}" - -test: - FORGE_HOME=/tmp/forge ./scanGoSrc - -install: - GO111MODULE=off go install \ - -ldflags "-X main.VERSION=${VERSION} -X main.BUILDTIME=${BUILDTIME} -X gui.GUIVERSION=${VERSION}" - -goimports: - goimports -w *.go - -prep: - go get -v -t -u - -run: - go run *.go - -clean: - -rm -f scanGoSrc diff --git a/scanGoSrc/argv.go b/scanGoSrc/argv.go deleted file mode 100644 index 635989f..0000000 --- a/scanGoSrc/argv.go +++ /dev/null @@ -1,50 +0,0 @@ -package main - -import ( - "os" - - "go.wit.com/dev/alexflint/arg" -) - -var argv args - -type args struct { - ConfigDir string `arg:"env:FORGE_HOME" help:"defaults to ~/.config/forge/"` - List bool `arg:"--list" default:"false" help:"list repos in your config"` - Add bool `arg:"--add" default:"false" help:"add a new repo"` - Delete bool `arg:"--delete" default:"false" help:"delete a repo"` - Update bool `arg:"--update" default:"false" help:"update a repo"` - GoPath string `arg:"--gopath" help:"gopath of the repo"` - Directory bool `arg:"--directory" default:"false" help:"repo is a directory to match against"` - ReadOnly bool `arg:"--readonly" default:"false" help:"repo is readonly"` - Writable bool `arg:"--writable" default:"false" help:"repo is writable"` - Favorite bool `arg:"--favorite" default:"false" help:"forge will always go-clone or git clone this"` - Private bool `arg:"--private" default:"false" help:"repo can not be published"` - Interesting bool `arg:"--interesting" default:"false" help:"something you decided was cool"` -} - -func (a args) Description() string { - return ` - forgeConfig -- add entries to your config files - -This is just example protobuf code to test forgepb is working -but it could be used to automagically create a config file too. - -If you need to change your config file, just edit the forge.text or forge.json -files then remove the forge.pb and ConfigLoad() will attempt to load those files instead -` -} - -func (args) Version() string { - return "virtigo " + VERSION -} - -func init() { - var pp *arg.Parser - pp = arg.MustParse(&argv) - - if pp == nil { - pp.WriteHelp(os.Stdout) - os.Exit(0) - } -} diff --git a/scanGoSrc/main.go b/scanGoSrc/main.go deleted file mode 100644 index f59ea77..0000000 --- a/scanGoSrc/main.go +++ /dev/null @@ -1,54 +0,0 @@ -package main - -import ( - "os" - - "go.wit.com/lib/protobuf/gitpb" - "go.wit.com/log" -) - -// sent via ldflags -var VERSION string - -func main() { - var repos *gitpb.Repos - repos = new(gitpb.Repos) - - newr, err := repos.NewGoPath("/home/jcarr/go/src", "go.wit.com/apps/wit-package") - if err != nil { - log.Info("init failed", err) - panic("crapnuts") - } else { - log.Info("init worked for", newr.GoPath) - } - - newr, err = repos.NewGoPath("/home/jcarr/go/src", "go.wit.com/apps/notathing") - if err != nil { - log.Info("init failed correctly:", err) - } else { - log.Info("init should have failed for", newr.GoPath) - panic("crapnuts") - } - - /* - log.Info(forgepb.RepoHeader()) - loop := repos.SortByPath() // get the list of repos - for loop.Scan() { - r := loop.Repo() - log.Info("repo:", r.GoPath) - } - */ - /* - log.Info("going to add a new repo", argv.GoPath) - new1 := forgepb.Repo{ - GoPath: argv.GoPath, - Writable: argv.Writable, - ReadOnly: argv.ReadOnly, - Private: argv.Private, - Directory: argv.Directory, - Favorite: argv.Favorite, - Interesting: argv.Interesting, - } - */ - os.Exit(0) -} diff --git a/validate/Makefile b/validate/Makefile deleted file mode 100644 index 1e51eb6..0000000 --- a/validate/Makefile +++ /dev/null @@ -1,21 +0,0 @@ -VERSION = $(shell git describe --tags) -BUILDTIME = $(shell date +%Y.%m.%d) - -build: - GO111MODULE=off go build \ - -ldflags "-X main.VERSION=${VERSION} -X main.BUILDTIME=${BUILDTIME} -X gui.GUIVERSION=${VERSION}" - -test: - ./validate --repo go.wit.com/apps/wit-package - -goimports: - goimports -w *.go - -prep: - go get -v -t -u - -run: - go run *.go - -clean: - -rm -f scanGoSrc diff --git a/validate/argv.go b/validate/argv.go deleted file mode 100644 index 35dd9a9..0000000 --- a/validate/argv.go +++ /dev/null @@ -1,42 +0,0 @@ -package main - -import ( - "os" - - "go.wit.com/dev/alexflint/arg" -) - -var argv args - -type args struct { - Repo string `arg:"--repo" help:"repo to check"` - List bool `arg:"--list" default:"false" help:"list repos in your config"` - SaveConfig bool `arg:"--save" default:"false" help:"save your config file at the end"` - Interesting bool `arg:"--interesting" default:"false" help:"something you decided was cool"` -} - -func (a args) Description() string { - return ` - forgeConfig -- add entries to your config files - -This is just example protobuf code to test forgepb is working -but it could be used to automagically create a config file too. - -If you need to change your config file, just edit the forge.text or forge.json -files then remove the forge.pb and ConfigLoad() will attempt to load those files instead -` -} - -func (args) Version() string { - return "virtigo " + VERSION -} - -func init() { - var pp *arg.Parser - pp = arg.MustParse(&argv) - - if pp == nil { - pp.WriteHelp(os.Stdout) - os.Exit(0) - } -} diff --git a/validate/main.go b/validate/main.go deleted file mode 100644 index 7c32ac6..0000000 --- a/validate/main.go +++ /dev/null @@ -1,97 +0,0 @@ -package main - -import ( - "fmt" - "os" - - "go.wit.com/dev/alexflint/arg" - "go.wit.com/gui" - "go.wit.com/lib/gui/repolist" - "go.wit.com/lib/protobuf/forgepb" - "go.wit.com/lib/protobuf/gitpb" - "go.wit.com/log" -) - -// sent via ldflags -var VERSION string - -var pp *arg.Parser -var forge *forgepb.Forge -var myGui *gui.Node -var rv *repolist.RepoList -var argvRepo *gitpb.Repo - -func main() { - pp = arg.MustParse(&argv) - - // load the ~/.config/forge/ config - forge = forgepb.Init() - // forge.ConfigPrintTable() - os.Setenv("REPO_WORK_PATH", forge.GetGoSrc()) - - myGui = gui.New() - myGui.Default() - - repos := forge.Repos.SortByGoPath() - for repos.Scan() { - repo := repos.Next() - if ! repo.IsValid() { - continue - } - // forge.VerifyBranchNames(repo) - fullpath := repo.GetFullPath() - mName := repo.GetMasterBranchName() - dName := repo.GetDevelBranchName() - uName := repo.GetUserBranchName() - dlen := repo.GoDepsLen() - plen := repo.PublishedLen() - var ds, ps string - if dlen == 0 { - ds = " " - } else { - ds = fmt.Sprintf("%2d", dlen) - } - if plen == 0 { - ps = " " - } else { - ps = fmt.Sprintf("%2d", plen) - } - log.Printf("repo: %-60s %-10s %-8s %-8s %s %s %s\n", fullpath, mName, dName, uName, ds, ps, repo.RepoType()) - /* - if repo.GoDepsChanged() { - log.Printf("\tdependancy checks indicate a new release is needed for %s\n", repo.GetGoPath()) - } else { - log.Printf("\tdependancies have not changed for %s\n", repo.GetGoPath()) - } - */ - } - - if argv.Repo == "" { - log.Info("no --repo") - os.Exit(-1) - } - - check := forge.Repos.FindByGoPath(argv.Repo) - if check == nil { - log.Info("boo, you didn't git check", argv.Repo) - os.Exit(-1) - } - check.RedoGoMod() - - match, err := forge.Repos.GoDepsChanged(check) - if err != nil { - log.Info("dependancy checks failed", check.GetGoPath(), err) - os.Exit(-1) - } - if match { - log.Printf("dependancy checks indicate a new release is needed for %s\n", check.GetGoPath()) - } else { - log.Printf("dependancies have not changed for %s\n", check.GetGoPath()) - } - - if argv.SaveConfig { - forge.Repos.ConfigSave() - } - - os.Exit(0) -} |
