more code reorg

Signed-off-by: Jeff Carr <jcarr@wit.com>
This commit is contained in:
Jeff Carr 2024-02-14 00:26:58 -06:00
parent 07a60ffe3c
commit a223e9f1c3
2 changed files with 25 additions and 27 deletions

View File

@ -38,30 +38,4 @@ func (rs *RepoStatus) makeBranchesBox() {
log.Log(WARN, "Branches are not perfect")
}
})
newgrid.NextRow()
newgrid.NewButton("show .git/config", func() {
if rs.gitConfig == nil {
log.Log(WARN, "Nonexistant or damaged .git/config", rs.String())
return
}
log.Log(WARN, ".git/config:", rs.realPath.String())
// The info:
for name, remote := range rs.gitConfig.remotes {
log.Log(WARN, " ", name, "url:", remote.url)
}
for name, branch := range rs.gitConfig.branches {
log.Log(WARN, " ", name, "remote:", branch.remote, "merge", branch.merge)
}
})
newgrid.NextRow()
newgrid.NewButton("CheckDirty()", func() {
if rs.CheckDirty() {
log.Log(WARN, "is dirty")
} else {
log.Log(WARN, "is not dirty")
}
})
}

View File

@ -13,7 +13,15 @@ func (rs *RepoStatus) drawGitCommands() {
rs.Update()
})
newgrid.NewButton("Show tags", func() {
newgrid.NewButton("CheckDirty()", func() {
if rs.CheckDirty() {
log.Log(WARN, "is dirty")
} else {
log.Log(WARN, "is not dirty")
}
})
newgrid.NewButton("git tags window", func() {
if rs.TagsW == nil {
log.Warn("error: found rs.TagsW == nil")
rs.TagsW = rs.TagWindow()
@ -25,6 +33,22 @@ func (rs *RepoStatus) drawGitCommands() {
rs.TagsW.Show()
}
})
newgrid.NewButton("show .git/config", func() {
if rs.gitConfig == nil {
log.Log(WARN, "Nonexistant or damaged .git/config", rs.String())
return
}
log.Log(WARN, ".git/config:", rs.realPath.String())
// The info:
for name, remote := range rs.gitConfig.remotes {
log.Log(WARN, " ", name, "url:", remote.url)
}
for name, branch := range rs.gitConfig.branches {
log.Log(WARN, " ", name, "remote:", branch.remote, "merge", branch.merge)
}
})
newgrid.NextRow()
newgrid.NewButton("git pull", func() {