diff options
| -rw-r--r-- | argv.go | 9 | ||||
| -rw-r--r-- | doGit.go | 17 |
2 files changed, 26 insertions, 0 deletions
@@ -31,6 +31,7 @@ type args struct { Droplet *DropletCmd `arg:"subcommand:droplet" help:"do things on virtual machines"` Upgrade *UpgradeCmd `arg:"subcommand:upgrade" help:"apt upgrade packages installed from mirrors.wit.com"` Publish *PublishCmd `arg:"subcommand:publish" help:"publish packages"` + Gui *GuiCmd `arg:"subcommand:gui" help:"start the gui"` RepoMap string `arg:"--repomap" help:"location of the repomap"` DryRun bool `arg:"--dry-run" help:"only show what would be packaged"` Install bool `arg:"--install" help:"go install the binaries first"` @@ -56,6 +57,12 @@ type DropletCmd struct { Trim *EmptyCmd `arg:"subcommand:trim" help:"clean out stuff and power off vm"` } +type GuiCmd struct { + GuiToolkit string `arg:"--gui" help:"which GUI toolkit to load"` + GuiDebug string `arg:"--gui-debug" help:"enable GUI debugging"` + GuiBuild string `arg:"--gui-build" help:"build the GUI plugins"` +} + type LinuxCmd struct { Rdate *EmptyCmd `arg:"subcommand:rdate" help:"rdate: check the time from the network"` } @@ -102,6 +109,8 @@ type GitCmd struct { Pull *EmptyCmd `arg:"subcommand:pull" help:"pull the wit standard paths"` Push *EmptyCmd `arg:"subcommand:push" help:"push the wit standard paths"` Create string `arg:"--create" help:"create new repo"` + Edit string `arg:"--edit" help:"edit the subject of the last commit"` + ChopHEAD int `arg:"--chop-head-off" help:"remove the last commit (HEAD-1)"` DeleteUntracked bool `arg:"--delete-untracked" help:"delete the untracked files"` } @@ -36,6 +36,15 @@ func doGitCreate(namespace string) (string, error) { return s, err } +func runCommand(cmd []string) (string, error) { + var err error + s := log.Sprintf("cmd= %v ", cmd) + if fhelp.QuestionUser("Run " + s + " here") { + _, err = shell.RunVerbose(cmd) + } + return "Ran " + s, err +} + func doGit() (string, error) { var s string var err error @@ -51,6 +60,14 @@ func doGit() (string, error) { s = "attmepting to create new repo" } + if argv.Git.Edit != "" { + s = "changing the last commit message" + } + + if argv.Git.ChopHEAD != 0 { + s, err = runCommand([]string{"git", "reset", "--hard", fmt.Sprintf("HEAD-%d", argv.Git.ChopHEAD)}) + } + if argv.Git.Tag != nil { cmd := []string{"git", "for-each-ref", "--sort=taggerdate", "--format"} cmd = append(cmd, "%(tag)%00%(taggerdate:raw)%00%(taggername)%00%(subject)") |
