properly set name for the 'user' branch

Signed-off-by: Jeff Carr <jcarr@wit.com>
This commit is contained in:
Jeff Carr 2024-01-14 13:29:24 -06:00
parent 269490693e
commit 68b7338b62
5 changed files with 42 additions and 30 deletions

14
go.mod
View File

@ -3,16 +3,16 @@ module go.wit.com/apps/myrepos
go 1.21.4
require (
go.wit.com/apps/control-panel-dns v0.12.1
go.wit.com/gui/gadgets v0.10.3
go.wit.com/gui/gadgets/repostatus v0.0.0-20240110012216-abd9781d8a60
go.wit.com/gui/gui v0.12.4
go.wit.com/log v0.5.1
go.wit.com/apps/control-panel-dns v0.12.2
go.wit.com/gui/gadgets v0.12.2
go.wit.com/gui/gadgets/repostatus v0.12.2
go.wit.com/gui/gui v0.12.6
go.wit.com/log v0.5.3
)
require (
github.com/alexflint/go-scalar v1.2.0 // indirect
go.wit.com/dev/alexflint/go-arg v1.4.4 // indirect
go.wit.com/dev/alexflint/go-arg v1.4.6 // indirect
go.wit.com/dev/davecgh/spew v1.1.3 // indirect
go.wit.com/gui/widget v0.0.0-20240105185907-84aafa536a93 // indirect
go.wit.com/spew v0.0.0-20240101141411-c7b8e91573c9 // indirect
)

28
go.sum
View File

@ -7,21 +7,21 @@ github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZN
github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk=
github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
go.wit.com/apps/control-panel-dns v0.12.1 h1:FBaNeSPIoyBXWir4ggxFiaBpHtGnbOj+GGHbK3Rpbo0=
go.wit.com/apps/control-panel-dns v0.12.1/go.mod h1:y+DRqorB3K/xAiDSil5cCVUalsJzMdUQuK9HambO0fQ=
go.wit.com/dev/alexflint/go-arg v1.4.4 h1:n7sDAPpaxzZ/nGKyVRj1Y/V0H18frfqSwI8yFe/9BGc=
go.wit.com/dev/alexflint/go-arg v1.4.4/go.mod h1:td08jpeZ4vQ/Bu870In78YE2QRrNXhxvY1A34hC7qFo=
go.wit.com/gui/gadgets v0.10.3 h1:sL1GULM8Aedch3kSBdm4XuYMz/TfJ+pPeha/927/pGU=
go.wit.com/gui/gadgets v0.10.3/go.mod h1:9bgxU4rUi4NQaZCgvuLvo6BwHsCx35kNyDalztYNT3A=
go.wit.com/gui/gadgets/repostatus v0.0.0-20240110012216-abd9781d8a60 h1:7Oppvb22yhrNbYJlUJzOeTDrb3Edll4d4xfprmFe8qw=
go.wit.com/gui/gadgets/repostatus v0.0.0-20240110012216-abd9781d8a60/go.mod h1:XMqxjysTEnVeFfDbeWsA5BEDde1KfU9+Yx7YnWSqRRk=
go.wit.com/gui/gui v0.12.4 h1:99fXbCk5r/5Fg11O7Rsq6mUGltK3v8yfX2f06eaYIkU=
go.wit.com/gui/gui v0.12.4/go.mod h1:WrAJB4kIR/U0z/PzrkYYQG6QeuXDLcpgiH5vXnz5I1s=
go.wit.com/apps/control-panel-dns v0.12.2 h1:YkqiEbGcJIXX8n0L5sYsfDz3nd5/J5YaUTln+38VNOs=
go.wit.com/apps/control-panel-dns v0.12.2/go.mod h1:y+DRqorB3K/xAiDSil5cCVUalsJzMdUQuK9HambO0fQ=
go.wit.com/dev/alexflint/go-arg v1.4.6 h1:0kxl4YQvC8t89eGIY5e/qPSMKWmLc32aJXF08g8jRlA=
go.wit.com/dev/alexflint/go-arg v1.4.6/go.mod h1:td08jpeZ4vQ/Bu870In78YE2QRrNXhxvY1A34hC7qFo=
go.wit.com/dev/davecgh/spew v1.1.3 h1:hqnB5qsPgC2cLZaJXqQJspQ5n/Ugry9kyL3tLk0hVzQ=
go.wit.com/dev/davecgh/spew v1.1.3/go.mod h1:sihvWmnQ/09FWplnEmozt90CCVqBtGuPXM811tgfhFA=
go.wit.com/gui/gadgets v0.12.2 h1:mjlTLJHHcrt4UAgs8TlzanDU/1fX314dOBzTVg0KP4o=
go.wit.com/gui/gadgets v0.12.2/go.mod h1:9bgxU4rUi4NQaZCgvuLvo6BwHsCx35kNyDalztYNT3A=
go.wit.com/gui/gadgets/repostatus v0.12.2 h1:wRUAsNmQksyqZez8feLehim7MgwYoHBusCz2juyLt1E=
go.wit.com/gui/gadgets/repostatus v0.12.2/go.mod h1:xIfy2RGM9jjSJxO7el2JwpwIQ23as8TI1dQgclUOJFs=
go.wit.com/gui/gui v0.12.6 h1:GvLqXShPa8Y1gIHNHKeMQgEQljGw0AWBLBrJg7IxaNE=
go.wit.com/gui/gui v0.12.6/go.mod h1:WrAJB4kIR/U0z/PzrkYYQG6QeuXDLcpgiH5vXnz5I1s=
go.wit.com/gui/widget v0.0.0-20240105185907-84aafa536a93 h1:zCzaHvXJJ/rWXmDc/v79VvM6W2lxxzJGfnW2lHCv3Ho=
go.wit.com/gui/widget v0.0.0-20240105185907-84aafa536a93/go.mod h1:A6/FaiFQtAHTjgo7c4FrokXe6bXX1Cowo35b2Lgi31E=
go.wit.com/log v0.5.1 h1:D1Gdpo+EIOZDnBmW2SJCmqSD30ZWTGZ++NXyXeyMd2Y=
go.wit.com/log v0.5.1/go.mod h1:0oxmE+WavwUZspnVAcOuIjS3vx7qVOFXj3vmUqKlzTE=
go.wit.com/spew v0.0.0-20240101141411-c7b8e91573c9 h1:UEX2EzLQPzLTfy/kUFQD7OXtvKn8wk/+jpDOkbl4ff4=
go.wit.com/spew v0.0.0-20240101141411-c7b8e91573c9/go.mod h1:qBpgJXThMMT15vym7/E4Ur9y8oOo2nP7t2RP52QHUNw=
go.wit.com/log v0.5.3 h1:/zHkniOPusPEuX1R401rMny9uwSO/nSU/QOMx6qoEnE=
go.wit.com/log v0.5.3/go.mod h1:LzIzVxc2xJQxWQBtV9VbV605P4TOxmYDCl+BZF38yGE=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=

16
main.go
View File

@ -35,22 +35,25 @@ func addRepo(grid *gui.Node, path string, master string, devel string, user stri
newRepo.lastLabel = grid.NewLabel("")
newRepo.vLabel = grid.NewLabel("")
newRepo.masterName = grid.NewLabel("")
newRepo.masterVersion = grid.NewLabel("")
newRepo.develName = grid.NewLabel("")
newRepo.develVersion = grid.NewLabel("")
newRepo.jcarrVersion = grid.NewLabel("")
newRepo.userName = grid.NewLabel("")
newRepo.userVersion = grid.NewLabel("")
newRepo.dirtyLabel = grid.NewLabel("")
newRepo.pButton = grid.NewButton("rescan", func () {
newRepo.newScan()
})
grid.NewButton("Toggle()", func () {
grid.NewButton("Hide()", func () {
if newRepo.status == nil {
log.Warn("status window doesn't exist")
return
}
log.Warn("status window exists. trying Show() here")
newRepo.status.Show()
log.Warn("status window exists. trying Hide() here")
newRepo.status.Hide()
})
grid.NewButton("Show()", func () {
if newRepo.status == nil {
@ -80,7 +83,7 @@ func repoworld() {
reposbox = reposwin.Box().NewBox("bw vbox", false)
reposgroup = reposbox.NewGroup("go repositories (read from ~/.config/myrepolist)")
reposgrid = reposgroup.NewGrid("test", 11, 1)
reposgrid = reposgroup.NewGrid("test", 14, 1)
reposgrid.NewLabel("")
reposgrid.NewLabel("branch")
@ -88,8 +91,11 @@ func repoworld() {
reposgrid.NewLabel("Current Version")
// reposgrid.NewLabel("tags")
reposgrid.NewLabel("master")
reposgrid.NewLabel("version")
reposgrid.NewLabel("devel")
reposgrid.NewLabel("version")
reposgrid.NewLabel("user")
reposgrid.NewLabel("version")
reposgrid.NewLabel("Status")
reposgrid.NewLabel("commit")
reposgrid.NewLabel("Toggle()")

View File

@ -20,16 +20,19 @@ func (r *repo) newScan() bool {
return false
}
mn := r.status.GetMasterName()
r.masterName.Set(mn)
mv := r.status.GetMasterVersion()
r.masterVersion.Set(mn + "\n" + mv)
r.masterVersion.Set(mv)
dn := r.status.GetDevelName()
r.develName.Set(dn)
dv := r.status.GetDevelVersion()
r.develVersion.Set(dn + "\n" + dv)
r.develVersion.Set(dv)
un := r.status.GetUserName()
r.userName.Set(un)
uv := r.status.GetUserVersion()
r.jcarrVersion.Set(un + "\n" + uv)
r.userVersion.Set(uv)
cbname := r.status.GetCurrentBranchName()
cbversion := r.status.GetCurrentBranchVersion()

View File

@ -29,9 +29,12 @@ type repo struct {
// tagsDrop *gui.Node // list of all tags
dirtyLabel *gui.Node // git state (dirty or not?)
masterName *gui.Node // the master branch name
masterVersion *gui.Node // the master branch version
develName *gui.Node // the devel branch name
develVersion *gui.Node // the devel branch version
jcarrVersion *gui.Node // the jcarr branch version
userName *gui.Node // the jcarr branch name
userVersion *gui.Node // the jcarr branch version
cButton *gui.Node // commit button
pButton *gui.Node // push button