cleanup tag list

This commit is contained in:
Jeff Carr 2025-09-22 23:02:59 -05:00
parent a9c4b21b35
commit e300719241
3 changed files with 57 additions and 58 deletions

14
argv.go
View File

@ -155,7 +155,7 @@ func DoAutoComplete(pb *prep.Auto) {
case "checkout": case "checkout":
pb.Autocomplete2("devel master user") pb.Autocomplete2("devel master user")
case "clean": case "clean":
fmt.Println("--force verify --repo") pb.Autocomplete2("")
case "commit": case "commit":
pb.Autocomplete2("--all") pb.Autocomplete2("--all")
case "config": case "config":
@ -171,19 +171,11 @@ func DoAutoComplete(pb *prep.Auto) {
case "merge": case "merge":
pb.Autocomplete2("devel master --all") pb.Autocomplete2("devel master --all")
case "normal": case "normal":
fmt.Println("on off") pb.Autocomplete2("on off")
case "pull": case "pull":
fmt.Println("--force check") pb.Autocomplete2("--force check")
case "patch": case "patch":
fmt.Println("check get list repos submit show") fmt.Println("check get list repos submit show")
case "user":
fmt.Println("--force")
case "devel":
fmt.Println("--force")
case "master":
fmt.Println("")
case "verify":
fmt.Println("user devel master")
case "tag": case "tag":
fmt.Println("list --delete clean") fmt.Println("list --delete clean")
default: default:

View File

@ -39,7 +39,7 @@ func doTag() error {
if argv.Tag.List != nil { if argv.Tag.List != nil {
repo := findCurrentPwdRepoOrDie() repo := findCurrentPwdRepoOrDie()
tagTablePB := makeTagTablePB(repo.Tags) tagTablePB := makeTagTablePB(repo, repo.Tags)
// tbox := win.Bottom.Box().SetProgName("TBOX") // tbox := win.Bottom.Box().SetProgName("TBOX")
// t.SetParent(tbox) // t.SetParent(tbox)
tagTablePB.MakeTable() tagTablePB.MakeTable()
@ -80,40 +80,46 @@ func doTag() error {
return nil return nil
} }
func makeTagTablePB(pb *gitpb.GitTags) *gitpb.GitTagsTable { func makeTagTablePB(repo *gitpb.Repo, pb *gitpb.GitTags) *gitpb.GitTagsTable {
t := pb.NewTable("tagList") t := pb.NewTable("tagList")
t.NewUuid() t.NewUuid()
col := t.AddHash() col := t.AddHash()
col.Width = 12 col.Width = 12
col = t.AddStringFunc("Ref Name", func(r *gitpb.GitTag) string { col = t.AddStringFunc("bashash", func(tag *gitpb.GitTag) string {
_, ref := filepath.Split(r.GetRefname()) _, base := filepath.Split(tag.Refname)
return ref cmd, err := repo.RunStrict([]string{"git", "log", "-1", base, "--format=%H"})
if err != nil {
return "err"
}
if len(cmd.Stdout) == 0 {
return ""
}
return cmd.Stdout[0]
}) })
col.Width = 16 col.Width = 12
// col.Width = -1
col = t.AddTimeFunc("age", func(repo *gitpb.GitTag) time.Time {
// todo
return time.Now()
})
col.Width = 6
col = t.AddTimeFunc("ctime", func(tag *gitpb.GitTag) time.Time { col = t.AddTimeFunc("ctime", func(tag *gitpb.GitTag) time.Time {
// todo // todo
return tag.Creatordate.AsTime() return tag.Creatordate.AsTime()
}) })
col.Width = 16 col.Width = 4
col = t.AddIntFunc("int", func(tag *gitpb.GitTag) int { col = t.AddTimeFunc("age", func(repo *gitpb.GitTag) time.Time {
// todo // todo
return 3 return time.Now()
}) })
col.Width = 4 col.Width = 4
col = t.AddSubject() col = t.AddStringFunc("Ref Name", func(r *gitpb.GitTag) string {
_, ref := filepath.Split(r.GetRefname())
return ref
})
col.Width = 16 col.Width = 16
col = t.AddSubject()
col.Width = -1
return t return t
} }

3
doc.go
View File

@ -1,10 +1,10 @@
/* /*
forge -- a tool to manage lots of git repos. forge includes a GUI and TUI. forge -- a tool to manage lots of git repos. forge includes a GUI and TUI.
forge only executes the 'git' command. Everything it does, you can run by hand with 'git'. forge only executes the 'git' command. Everything it does, you can run by hand with 'git'.
Options: Options:
--debugger open the debugger window --debugger open the debugger window
--logger open the log.* control window --logger open the log.* control window
--gui GUI select the plugin (andlabs,gocui,etc) --gui GUI select the plugin (andlabs,gocui,etc)
@ -22,6 +22,7 @@ Options:
--version display version and exit --version display version and exit
Commands: Commands:
help New to forge? This is for you.' help New to forge? This is for you.'
checkout switch branches using 'git checkout' checkout switch branches using 'git checkout'
clean start over at the beginning clean start over at the beginning