Compare commits
No commits in common. "9c87e1a04091de3583c4edd0d5f524c7c3e838eb" and "a9c4b21b355ee00cc5241f39b745d2306579dfd1" have entirely different histories.
9c87e1a040
...
a9c4b21b35
14
argv.go
14
argv.go
|
@ -155,7 +155,7 @@ func DoAutoComplete(pb *prep.Auto) {
|
|||
case "checkout":
|
||||
pb.Autocomplete2("devel master user")
|
||||
case "clean":
|
||||
pb.Autocomplete2("")
|
||||
fmt.Println("--force verify --repo")
|
||||
case "commit":
|
||||
pb.Autocomplete2("--all")
|
||||
case "config":
|
||||
|
@ -171,11 +171,19 @@ func DoAutoComplete(pb *prep.Auto) {
|
|||
case "merge":
|
||||
pb.Autocomplete2("devel master --all")
|
||||
case "normal":
|
||||
pb.Autocomplete2("on off")
|
||||
fmt.Println("on off")
|
||||
case "pull":
|
||||
pb.Autocomplete2("--force check")
|
||||
fmt.Println("--force check")
|
||||
case "patch":
|
||||
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":
|
||||
fmt.Println("list --delete clean")
|
||||
default:
|
||||
|
|
15
doPatch.go
15
doPatch.go
|
@ -45,16 +45,7 @@ func doPatchSubmit() error {
|
|||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if pset.Patches == nil {
|
||||
log.Info("pset.Patches == nil")
|
||||
return err
|
||||
}
|
||||
if pset.Patches.Len() == 0 {
|
||||
log.Info("did not find any patches")
|
||||
return nil
|
||||
}
|
||||
pset.PrintTable()
|
||||
_, _, err = pset.HttpPost(myServer(), "new")
|
||||
_, _, err = pset.Patches.HttpPostVerbose(myServer(), "new")
|
||||
return err
|
||||
}
|
||||
|
||||
|
@ -73,7 +64,7 @@ func doPatch() error {
|
|||
}
|
||||
|
||||
if argv.Patch.Get != nil {
|
||||
psets := forgepb.NewSets()
|
||||
psets := forgepb.NewPatchsets()
|
||||
newpb, _, _ := psets.HttpPostVerbose(myServer(), "get")
|
||||
newpb.PrintTable()
|
||||
me.forge.Patchsets = newpb
|
||||
|
@ -193,7 +184,7 @@ func dumpWorkRepos() bool {
|
|||
|
||||
// returns bad if patches can not be applied
|
||||
// logic is not great here but it was a first pass
|
||||
func dumpPatchset(pset *forgepb.Set) bool {
|
||||
func dumpPatchset(pset *forgepb.Patchset) bool {
|
||||
// don't even bother to continue if we already know it's broken
|
||||
if pset.State == "BROKEN" {
|
||||
log.Printf("Patchset Name: %-24s Author: %s <%s> IS BAD\n", pset.Name, pset.GetGitAuthorName(), pset.GetGitAuthorEmail())
|
||||
|
|
50
doTag.go
50
doTag.go
|
@ -39,7 +39,7 @@ func doTag() error {
|
|||
if argv.Tag.List != nil {
|
||||
repo := findCurrentPwdRepoOrDie()
|
||||
|
||||
tagTablePB := makeTagTablePB(repo, repo.Tags)
|
||||
tagTablePB := makeTagTablePB(repo.Tags)
|
||||
// tbox := win.Bottom.Box().SetProgName("TBOX")
|
||||
// t.SetParent(tbox)
|
||||
tagTablePB.MakeTable()
|
||||
|
@ -80,46 +80,40 @@ func doTag() error {
|
|||
return nil
|
||||
}
|
||||
|
||||
func makeTagTablePB(repo *gitpb.Repo, pb *gitpb.GitTags) *gitpb.GitTagsTable {
|
||||
func makeTagTablePB(pb *gitpb.GitTags) *gitpb.GitTagsTable {
|
||||
t := pb.NewTable("tagList")
|
||||
t.NewUuid()
|
||||
|
||||
col := t.AddHash()
|
||||
col.Width = 12
|
||||
|
||||
col = t.AddStringFunc("bashash", func(tag *gitpb.GitTag) string {
|
||||
_, base := filepath.Split(tag.Refname)
|
||||
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 = 12
|
||||
|
||||
col = t.AddTimeFunc("ctime", func(tag *gitpb.GitTag) time.Time {
|
||||
// todo
|
||||
return tag.Creatordate.AsTime()
|
||||
})
|
||||
col.Width = 4
|
||||
|
||||
col = t.AddTimeFunc("age", func(repo *gitpb.GitTag) time.Time {
|
||||
// todo
|
||||
return time.Now()
|
||||
})
|
||||
col.Width = 4
|
||||
|
||||
col = t.AddStringFunc("Ref Name", func(r *gitpb.GitTag) string {
|
||||
_, ref := filepath.Split(r.GetRefname())
|
||||
return ref
|
||||
})
|
||||
col.Width = 16
|
||||
// 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 {
|
||||
// todo
|
||||
return tag.Creatordate.AsTime()
|
||||
})
|
||||
col.Width = 16
|
||||
|
||||
col = t.AddIntFunc("int", func(tag *gitpb.GitTag) int {
|
||||
// todo
|
||||
return 3
|
||||
})
|
||||
col.Width = 4
|
||||
|
||||
col = t.AddSubject()
|
||||
col.Width = -1
|
||||
col.Width = 16
|
||||
|
||||
return t
|
||||
}
|
||||
|
|
3
doc.go
3
doc.go
|
@ -1,10 +1,10 @@
|
|||
/*
|
||||
|
||||
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'.
|
||||
|
||||
Options:
|
||||
|
||||
--debugger open the debugger window
|
||||
--logger open the log.* control window
|
||||
--gui GUI select the plugin (andlabs,gocui,etc)
|
||||
|
@ -22,7 +22,6 @@ Options:
|
|||
--version display version and exit
|
||||
|
||||
Commands:
|
||||
|
||||
help New to forge? This is for you.'
|
||||
checkout switch branches using 'git checkout'
|
||||
clean start over at the beginning
|
||||
|
|
|
@ -38,7 +38,7 @@ type stdPatchsetTableWin struct {
|
|||
sync.Mutex
|
||||
win *gadgets.GenericWindow // the machines gui window
|
||||
box *gui.Node // the machines gui parent box widget
|
||||
TB *forgepb.SetsTable // the gui table buffer
|
||||
TB *forgepb.PatchsetsTable // the gui table buffer
|
||||
update bool // if the window should be updated
|
||||
}
|
||||
|
||||
|
@ -54,7 +54,7 @@ func (w *stdPatchsetTableWin) Toggle() {
|
|||
*/
|
||||
|
||||
/*
|
||||
etimef := func(e *forgepb.Set) string {
|
||||
etimef := func(e *forgepb.Patchset) string {
|
||||
etime := e.Etime.AsTime()
|
||||
s := etime.Format("2006/01/02 15:04")
|
||||
if strings.HasPrefix(s, "1970/") {
|
||||
|
@ -67,14 +67,14 @@ func (w *stdPatchsetTableWin) Toggle() {
|
|||
*/
|
||||
|
||||
/*
|
||||
ctimef := func(p *forgepb.Set) string {
|
||||
ctimef := func(p *forgepb.Patchset) string {
|
||||
ctime := p.Ctime.AsTime()
|
||||
return ctime.Format("2006/01/02 15:04")
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
func setPatchsetState(p *forgepb.Set) {
|
||||
func setPatchsetState(p *forgepb.Patchset) {
|
||||
var bad bool
|
||||
var good bool
|
||||
var done bool = true
|
||||
|
@ -209,7 +209,7 @@ func setNewCommitHash(patch *forgepb.Patch) bool {
|
|||
}
|
||||
|
||||
/*
|
||||
func setNewCommitHashLoop(p *forgepb.Set) bool {
|
||||
func setNewCommitHashLoop(p *forgepb.Patchset) bool {
|
||||
var done bool = true
|
||||
for patch := range p.Patches.IterAll() {
|
||||
setNewCommitHashLoop(patch)
|
||||
|
@ -219,7 +219,7 @@ func setNewCommitHashLoop(p *forgepb.Set) bool {
|
|||
}
|
||||
*/
|
||||
|
||||
func AddAllPatches(notdone *forgepb.Patches, pset *forgepb.Set, full bool) {
|
||||
func AddAllPatches(notdone *forgepb.Patches, pset *forgepb.Patchset, full bool) {
|
||||
for patch := range pset.Patches.IterAll() {
|
||||
comment := cleanSubject(patch.Comment)
|
||||
|
||||
|
@ -233,7 +233,7 @@ func AddAllPatches(notdone *forgepb.Patches, pset *forgepb.Set, full bool) {
|
|||
}
|
||||
}
|
||||
|
||||
func AddNotDonePatches(notdone *forgepb.Patches, pset *forgepb.Set, full bool) {
|
||||
func AddNotDonePatches(notdone *forgepb.Patches, pset *forgepb.Patchset, full bool) {
|
||||
for patch := range pset.Patches.IterAll() {
|
||||
comment := cleanSubject(patch.Comment)
|
||||
|
||||
|
|
|
@ -22,7 +22,7 @@ type repoPatchWindow struct {
|
|||
grid *gui.Node // the list of available patches
|
||||
// summary *patchSummary // summary of current patches
|
||||
setgrid *gui.Node // the list of each patchset
|
||||
pset *forgepb.Set // the patchset in question
|
||||
pset *forgepb.Patchset // the patchset in question
|
||||
}
|
||||
|
||||
// todo: autogenerate these or make them standared 'gui' package functions
|
||||
|
@ -109,7 +109,7 @@ func makeRepoPatchWindow(repo *gitpb.Repo, fset []*forgepb.Patch) *repoPatchWind
|
|||
return pw
|
||||
}
|
||||
|
||||
func (r *repoPatchWindow) addPatchset(grid *gui.Node, pset *forgepb.Set) {
|
||||
func (r *repoPatchWindow) addPatchset(grid *gui.Node, pset *forgepb.Patchset) {
|
||||
repomap := make(map[*gitpb.Repo][]*forgepb.Patch)
|
||||
repohash := make(map[*gitpb.Repo]string)
|
||||
|
||||
|
|
Loading…
Reference in New Issue