summaryrefslogtreecommitdiff
path: root/doGit.go
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2025-10-17 01:30:41 -0500
committerJeff Carr <[email protected]>2025-10-17 01:30:41 -0500
commit415ff4cf1905526b727623a92354b99fb9304c83 (patch)
treea8a6541baa09c3c900fec9421c43acba0cce2718 /doGit.go
parent2006b968539824fdb3177bd78f530de45fb9283f (diff)
what I actually started coding on 5 hours ago
before PB table GUI panic before forge not initing with old configs 10 minutes turned into 5 hours. tons of fun to work with GO compared to C. so fast.
Diffstat (limited to 'doGit.go')
-rw-r--r--doGit.go17
1 files changed, 17 insertions, 0 deletions
diff --git a/doGit.go b/doGit.go
index 90dbb18..42d7de6 100644
--- a/doGit.go
+++ b/doGit.go
@@ -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)")