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"` 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"` Config *ConfigCmd `arg:"subcommand:config" help:"show your .config/forge/ settings"`
Debug *DebugCmd `arg:"subcommand:debug" help:"debug forge"` 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'"` GitFetch *FindCmd `arg:"subcommand:fetch" help:"run 'git fetch master'"`
List *FindCmd `arg:"subcommand:list" help:"print a table of the current repos"` 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"` Patch *PatchCmd `arg:"subcommand:patch" help:"make patchsets"`
Pull *PullCmd `arg:"subcommand:pull" help:"run 'git pull'"` Pull *PullCmd `arg:"subcommand:pull" help:"run 'git pull'"`
URL string `arg:"--connect" help:"forge url"` URL string `arg:"--connect" help:"forge url"`
@ -106,6 +107,12 @@ type CheckoutCmd struct {
Master *FindCmd `arg:"subcommand:master" help:"git checkout master"` 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 { type SyncCmd struct {
Clean *EmptyCmd `arg:"subcommand:clean" help:"sync everything to upstream master"` Clean *EmptyCmd `arg:"subcommand:clean" help:"sync everything to upstream master"`
User *EmptyCmd `arg:"subcommand:user" help:"sync everything to user"` User *EmptyCmd `arg:"subcommand:user" help:"sync everything to user"`

View File

@ -45,6 +45,8 @@ func (args) doBashAuto() {
fmt.Println("fix") fmt.Println("fix")
case "list": case "list":
fmt.Println("--full") fmt.Println("--full")
case "merge":
fmt.Println("devel master")
case "pull": case "pull":
fmt.Println("dirty clean list patches sync --force") fmt.Println("dirty clean list patches sync --force")
case "--find": case "--find":
@ -64,7 +66,7 @@ func (args) doBashAuto() {
default: default:
if argv.BashAuto[0] == ARGNAME { if argv.BashAuto[0] == ARGNAME {
// list the subcommands here // 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) os.Exit(0)

11
main.go
View File

@ -7,6 +7,7 @@ package main
import ( import (
"embed" "embed"
"fmt"
"os" "os"
"strings" "strings"
@ -138,6 +139,16 @@ func main() {
okExit("") 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 != nil {
if argv.Pull.Sync != nil { if argv.Pull.Sync != nil {
if err := doSync(); err != nil { if err := doSync(); err != nil {