properly track user branch name and version

Signed-off-by: Jeff Carr <jcarr@wit.com>
This commit is contained in:
Jeff Carr 2024-01-14 13:21:40 -06:00
parent 4e19ff9946
commit 69957aadfc
5 changed files with 24 additions and 29 deletions

15
draw.go
View File

@ -48,15 +48,8 @@ func (rs *RepoStatus) drawGitBranches() {
master = "main"
}
}
// rs.masterDrop.Set(master)
// relabel the various gadgets with the right branch name
rs.masterBranchVersion.SetLabel(master)
// rs.major.SetTitle(master)
/*
rs.develDrop.Set("devel")
rs.userDrop.Set("jcarr")
*/
var count *gui.Node
@ -90,7 +83,7 @@ func (rs *RepoStatus) drawGitStatus() {
rs.tagsDrop = gadgets.NewBasicDropdown(newgrid, "existing tags")
rs.masterBranchVersion = gadgets.NewOneLiner(newgrid, "master")
rs.develBranchVersion = gadgets.NewOneLiner(newgrid, "devel")
rs.jcarrBranchVersion = gadgets.NewOneLiner(newgrid, "jcarr")
rs.userBranchVersion = gadgets.NewOneLiner(newgrid, "user")
rs.dirtyLabel = gadgets.NewOneLiner(newgrid, "dirty")
@ -249,9 +242,9 @@ func (rs *RepoStatus) recommend() {
log.Warn("list the known tags")
rs.DisableEverything()
rs.populateTags()
log.Warn("Does devel == jcarr?", rs.develBranchVersion.Get(), rs.jcarrBranchVersion.Get())
if rs.develBranchVersion.Get() != rs.jcarrBranchVersion.Get() {
log.Warn("devel does not equal jcarr")
log.Warn("Does devel == user?", rs.develBranchVersion.Get(), rs.userBranchVersion.Get())
if rs.develBranchVersion.Get() != rs.userBranchVersion.Get() {
log.Warn("devel does not equal user")
log.Warn("merge or squash?")
rs.EnableMergeDevel()
rs.setMergeUserCommands()

6
git.go
View File

@ -120,7 +120,7 @@ func (rs *RepoStatus) checkoutBranch(level string, branch string) {
case "devel":
rs.develBranchVersion.Set(realversion)
case "user":
rs.jcarrBranchVersion.Set(realversion)
rs.userBranchVersion.Set(realversion)
default:
}
}
@ -133,10 +133,12 @@ func (rs *RepoStatus) SetMasterName(s string) {
func (rs *RepoStatus) SetDevelName(s string) {
rs.develDrop.Set(s)
rs.develBranchVersion.SetLabel(s)
}
func (rs *RepoStatus) SetUserName(s string) {
rs.userDrop.Set(s)
rs.userBranchVersion.SetLabel(s)
}
// returns "master", "devel", os.Username, etc
@ -168,7 +170,7 @@ func (rs *RepoStatus) GetDevelVersion() string {
return name
}
func (rs *RepoStatus) GetUserVersion() string {
name := rs.jcarrBranchVersion.Get()
name := rs.userBranchVersion.Get()
log.Warn("GetUserVersion() =", name)
return name
}

10
go.mod
View File

@ -3,14 +3,14 @@ module go.wit.com/gui/gadgets/repostatus
go 1.21.4
require (
go.wit.com/gui/gadgets v0.10.3
go.wit.com/gui/gui v0.12.3
go.wit.com/log v0.5.1
go.wit.com/gui/gadgets 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/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
)

20
go.sum
View File

@ -7,17 +7,17 @@ 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/arg v1.4.4 h1:nfW8JUsVfyXi5l3BlTq5GGhesLlnyh3ICIm8cpM2U8w=
go.wit.com/arg v1.4.4/go.mod h1:P2JoYIsJ9SSvp45qSnYibQEQPNTuTB8dTkyT9y1btsI=
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/gui v0.12.3 h1:0hmW5nlfvp+XRYfc59XZG/pSe/89+tMJo12h95XH98M=
go.wit.com/gui/gui v0.12.3/go.mod h1:WrAJB4kIR/U0z/PzrkYYQG6QeuXDLcpgiH5vXnz5I1s=
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/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=

View File

@ -31,7 +31,7 @@ type RepoStatus struct {
lasttag *gadgets.OneLiner
masterBranchVersion *gadgets.OneLiner
develBranchVersion *gadgets.OneLiner
jcarrBranchVersion *gadgets.OneLiner
userBranchVersion *gadgets.OneLiner
develMerge *gui.Node
releaseVersion *gui.Node