From 08b7f2406ccfc5c249c5fb59e9229e37d40fdb4d Mon Sep 17 00:00:00 2001 From: Jeff Carr Date: Mon, 7 Jul 2025 17:34:10 -0500 Subject: [PATCH] more on 'forge pull' --- Makefile | 2 +- doPull.go | 58 ++++++++++++++++++++++++------------------------------- 2 files changed, 26 insertions(+), 34 deletions(-) diff --git a/Makefile b/Makefile index e3a65b6..4c9bbdd 100644 --- a/Makefile +++ b/Makefile @@ -60,4 +60,4 @@ devel: pull: install forge pull dirty - forge pull patches + # forge pull patches diff --git a/doPull.go b/doPull.go index d177784..b4aff68 100644 --- a/doPull.go +++ b/doPull.go @@ -48,49 +48,41 @@ func doGitPullNew() error { return fmt.Errorf("not really 'fetch pull'") } - if argv.GitPull.Dirty != nil { - found := findDirty() - me.forge.PrintHumanTableFull(found) + if argv.Force { + now := time.Now() + pullcount := 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) git pull total=%d\n", total, count, nope, shell.FormatDuration(time.Since(now)), pullcount) return nil } + check := gitpb.NewRepos() + + if argv.GitPull.Dirty != nil { + check = findDirty() + } + if argv.GitPull.Patches != nil { - check := findReposWithPatches() - me.forge.PrintHumanTableFull(check) - found, err := me.forge.LookupPB(check) - if err != nil { - return err - } - me.forge.PrintHumanTableFull(found) - return nil + check = findReposWithPatches() } - if argv.GitPull.Test != nil { - log.Info("list repo's with updates here") - found := doFind() - // me.forge.PrintHumanTable(found) - me.forge.PrintHumanTableFull(found) - /* - // print out the repos - if argv.List.Full { - me.forge.PrintHumanTableFull(found) - } else { - me.forge.PrintHumanTable(found) - } - */ - return nil + if check.Len() == 0 { + check = doFind() } - now := time.Now() - pullcount := me.forge.RillFuncError(rillPull) - count := me.forge.RillReload() - if count != 0 { - me.forge.ConfigSave() + me.forge.PrintHumanTableFull(check) + found, err := me.forge.LookupPB(check) + if err != nil { + return err } - - total, count, nope, _ := IsEverythingOnMaster() - log.Printf("Master branch check. %d total repos. (%d git pulled) (%d not on master branch) (%s) git pull total=%d\n", total, count, nope, shell.FormatDuration(time.Since(now)), pullcount) + me.forge.PrintHumanTableFull(found) return nil + } /*