This commit is contained in:
Jeff Carr 2025-07-07 20:39:34 -05:00
parent 5d57a8968d
commit 86e513d845
3 changed files with 22 additions and 2 deletions

View File

@ -20,9 +20,10 @@ type args struct {
Commit *CommitCmd `arg:"subcommand:commit" help:"'git commit' but errors out if on wrong branch"`
Config *ConfigCmd `arg:"subcommand:config" help:"show your .config/forge/ settings"`
Debug *DebugCmd `arg:"subcommand:debug" help:"debug forge"`
Dirty *DirtyCmd `arg:"subcommand:dirty" help:"show repos git says are dirty"`
Dirty *DirtyCmd `arg:"subcommand:dirty" help:"show dirty git repos"`
GitFetch *FindCmd `arg:"subcommand:fetch" help:"run 'git fetch master'"`
List *FindCmd `arg:"subcommand:list" help:"print a table of the current repos"`
Merge *MergeCmd `arg:"subcommand:merge" help:"merge branches"`
Patch *PatchCmd `arg:"subcommand:patch" help:"make patchsets"`
Pull *PullCmd `arg:"subcommand:pull" help:"run 'git pull'"`
URL string `arg:"--connect" help:"forge url"`
@ -106,6 +107,12 @@ type CheckoutCmd struct {
Master *FindCmd `arg:"subcommand:master" help:"git checkout master"`
}
type MergeCmd struct {
Devel *FindCmd `arg:"subcommand:devel" help:"merge user to devel"`
Master *FindCmd `arg:"subcommand:master" help:"merge devel to master"`
Publish *EmptyCmd `arg:"subcommand:publish" help:"increment versions and publish master branch"`
}
type SyncCmd struct {
Clean *EmptyCmd `arg:"subcommand:clean" help:"sync everything to upstream master"`
User *EmptyCmd `arg:"subcommand:user" help:"sync everything to user"`

View File

@ -45,6 +45,8 @@ func (args) doBashAuto() {
fmt.Println("fix")
case "list":
fmt.Println("--full")
case "merge":
fmt.Println("devel master")
case "pull":
fmt.Println("dirty clean list patches sync --force")
case "--find":
@ -64,7 +66,7 @@ func (args) doBashAuto() {
default:
if argv.BashAuto[0] == ARGNAME {
// list the subcommands here
fmt.Println("--bash list checkout commit config dirty debug fetch patch pull")
fmt.Println("--bash list checkout commit config dirty debug fetch merge patch pull")
}
}
os.Exit(0)

11
main.go
View File

@ -7,6 +7,7 @@ package main
import (
"embed"
"fmt"
"os"
"strings"
@ -138,6 +139,16 @@ func main() {
okExit("")
}
if argv.Merge != nil {
if argv.Merge.Devel != nil {
if _, err := doMergeDevel(); err != nil {
badExit(err)
}
okExit("devel merge ok")
}
badExit(fmt.Errorf("merge what?"))
}
if argv.Pull != nil {
if argv.Pull.Sync != nil {
if err := doSync(); err != nil {