fix defective google "Git on Borg" repos

This commit is contained in:
Jeff Carr 2025-04-04 06:07:56 -05:00
parent 99e30376f0
commit 06cf0f7d84
4 changed files with 19 additions and 6 deletions

View File

@ -101,6 +101,7 @@ type FindCmd struct {
Private bool `arg:"--private" help:"your private repos from your .config/forge/"`
Dirty bool `arg:"--dirty" help:"only use dirty git repos"`
User bool `arg:"--user" help:"show repos on the user branch"`
Full bool `arg:"--full" help:"show full repo names"`
// ReadOnly bool `arg:"--readonly" help:"include read-only repos"`
}

View File

@ -42,7 +42,7 @@ func (args) doBashAuto() {
case "examine":
fmt.Println("fix")
case "list":
fmt.Println("--all --mine --favorites --private")
fmt.Println("--full")
case "pull":
fmt.Println("--force")
case "patch":

View File

@ -5,6 +5,7 @@ package main
import (
"fmt"
"os"
"path/filepath"
"time"
@ -191,12 +192,19 @@ func rillCheckoutMaster(repo *gitpb.Repo) error {
// never do dirty repos
return nil
}
if repo.GetCurrentBranchName() == repo.GetMasterBranchName() {
// repo is already on master
// 'giterr' means something is very wrong with this repo
if repo.GetMasterVersion() == "giterr" {
repo.CheckoutMaster()
log.Info("master == giterr. BAD REPO", repo.GetFullPath())
log.Info("master == giterr. BAD REPO", repo.GetFullPath())
log.Info("master == giterr. BAD REPO", repo.GetFullPath())
cmd := []string{"git", "checkout", "main"} // todo: figure out main
repo.RunVerbose(cmd)
os.Exit(-1)
return nil
}
if repo.GetUserVersion() == "uerr" {
repo.CheckoutMaster()
if repo.GetCurrentBranchName() == repo.GetMasterBranchName() {
// repo is already on master
return nil
}
if me.forge.Config.IsReadOnly(repo.GetGoPath()) {

View File

@ -142,7 +142,11 @@ func main() {
if argv.List != nil {
found := argv.List.findRepos()
// print out the repos
me.forge.PrintHumanTable(found)
if argv.List.Full {
me.forge.PrintHumanTableFull(found)
} else {
me.forge.PrintHumanTable(found)
}
okExit("")
}