summaryrefslogtreecommitdiff
path: root/doGit.go
diff options
context:
space:
mode:
Diffstat (limited to 'doGit.go')
-rw-r--r--doGit.go18
1 files changed, 11 insertions, 7 deletions
diff --git a/doGit.go b/doGit.go
index 333ed57..ae1cb6f 100644
--- a/doGit.go
+++ b/doGit.go
@@ -15,7 +15,7 @@ import (
"go.wit.com/log"
)
-func doGit() error {
+func doGit() (string, error) {
log.DaemonMode(true)
defer log.DaemonMode(false)
@@ -23,7 +23,7 @@ func doGit() error {
fstr := "--format=\"%h %>(24)%ar %>(20)%an %s"
cmd := []string{"git", "log", fstr}
shell.RunVerbose(cmd)
- me.sh.GoodExit("")
+ return "git log", nil
}
if argv.Git.Tag != nil {
@@ -35,6 +35,7 @@ func doGit() error {
parts := strings.Split(line, "\x00")
log.Infof("LINE: %d len(%d) %v\n", i, len(parts), parts)
}
+ return "git tags", nil
}
if argv.Git.Who != nil {
@@ -48,19 +49,19 @@ func doGit() error {
}
cmd := []string{"git", "who"}
shell.RunVerbose(cmd)
- me.sh.GoodExit("")
+ return "git who", nil
}
if argv.Git.Pull != nil {
doPull(".config/wit")
doPull("tools")
- me.sh.GoodExit("")
+ return "git pull", nil
}
if argv.Git.Push != nil {
doPush(".config/wit")
doPush("tools")
- me.sh.GoodExit("")
+ return "git push", nil
}
if argv.Git.DeleteUntracked {
@@ -77,13 +78,16 @@ func doGit() error {
cmd := []string{"rm"}
cmd = append(cmd, files...)
_, err := fhelp.RunRealtimeError(cmd)
- return err
+ if err != nil {
+ log.Info("cmd failed", cmd, repo.FullPath, err)
+ return "rm failed", err
+ }
}
}
}
}
- return nil
+ return "todo: put something here", nil
}
func findRepo(wpath string) (*gitpb.Repo, bool) {