diff options
| author | Jeff Carr <[email protected]> | 2025-01-28 11:26:31 -0600 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2025-01-28 14:02:39 -0600 |
| commit | 7402aaded7b9f9587eb5ba863b732c9c9e8ee9fe (patch) | |
| tree | 7774a5b2132b810253fe213d4449bf382b539a4f /doPull.go | |
| parent | dd7355571d80b4d6c970e417df85244dbfd253e0 (diff) | |
fixes from cleaning an old set of reposv0.22.60
Diffstat (limited to 'doPull.go')
| -rw-r--r-- | doPull.go | 41 |
1 files changed, 41 insertions, 0 deletions
@@ -1,10 +1,50 @@ package main import ( + "time" + + "go.wit.com/lib/gui/shell" "go.wit.com/lib/protobuf/gitpb" "go.wit.com/log" ) +func rillPull(repo *gitpb.Repo) error { + if repo.IsDirty() { + // never do dirty repos + return nil + } + t, _ := repo.LastGitPull() + if time.Since(t) < time.Hour { + if argv.Verbose { + log.Info(repo.GetFullPath(), "git pulled too recently", shell.FormatDuration(time.Since(t))) + } + return nil + } + + var cmd []string + cmd = append(cmd, "git", "pull") + _, err := repo.RunVerbose(cmd) + if err != nil { + log.Info(repo.GetFullPath(), "git pull err:", err) + } + return nil +} + +// is every repo on the devel branch? + +func doGitPullNew() { + now := time.Now() + me.forge.RillFuncError(rillPull) + count := me.forge.RillReload() + if count != 0 { + me.forge.ConfigSave() + } + + total, count, nope, _ := IsEverythingOnMaster() + log.Printf("Master branch check. %d total repos. (%d git pulled) (%d not on master branch) (%s)\n", total, count, nope, shell.FormatDuration(time.Since(now))) +} + +/* func doGitPull() { allerr := me.found.RillGitPull(40, 5) @@ -29,6 +69,7 @@ func doGitPull() { } } +*/ // git fetch origin master:master func rillFetchMaster(repo *gitpb.Repo) error { |
