summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--doFix.deleteuser.go22
-rw-r--r--doNormal.go4
-rw-r--r--doPull.go16
-rw-r--r--doTag.go16
-rw-r--r--find.go2
5 files changed, 30 insertions, 30 deletions
diff --git a/doFix.deleteuser.go b/doFix.deleteuser.go
index f9878d4..da8bb11 100644
--- a/doFix.deleteuser.go
+++ b/doFix.deleteuser.go
@@ -58,12 +58,12 @@ func doFixPrint(s string, path string, cmd string) {
log.Printf("%-13.13s %-55.55s %s\n", s, path, cmd)
}
-func doFixDeleteUserBranches(repo *gitpb.Repo, remoteRef *gitpb.GitTag) *notesList {
+func doFixDeleteUserBranches(repo *gitpb.Repo, remoteRef *gitpb.Stat) *notesList {
// log.Info("delete remote user", repo.FullPath)
localTag := repo.IsBranchLocal(repo.GetUserBranchName())
if localTag != nil {
- // log.Info("THERE IS local user", repo.FullPath, localTag.Refname)
- doFixPrint("LOCAL USER", repo.FullPath, localTag.Refname+" local branch exists")
+ // log.Info("THERE IS local user", repo.FullPath, localTag.Name)
+ doFixPrint("LOCAL USER", repo.FullPath, localTag.Name+" local branch exists")
err, notes := doFixDeleteUserLocalBranch(repo, remoteRef, localTag)
if err != nil {
log.Printf("%-13.13s %-55.55s %v noteslen(%d)\n", "need --fix", repo.FullPath, err, len(notes.all))
@@ -77,10 +77,10 @@ func doFixDeleteUserBranches(repo *gitpb.Repo, remoteRef *gitpb.GitTag) *notesLi
}
// notes.addNote("SAFE", repo, remoteUser, line)
-func (notes *notesList) addNote(note string, repo *gitpb.Repo, ref *gitpb.GitTag, cmd []string, line string) {
+func (notes *notesList) addNote(note string, repo *gitpb.Repo, ref *gitpb.Stat, cmd []string, line string) {
newnote := new(DeleteBranchNotes)
newnote.Note = note
- newnote.Refname = ref.Refname
+ newnote.Name = ref.Name
newnote.Fullpath = repo.FullPath
newnote.Cmd = cmd
parts := strings.Split(line, "%00") // git log doesn't actually convert %00 to NULL
@@ -100,7 +100,7 @@ func (notes *notesList) addNote(note string, repo *gitpb.Repo, ref *gitpb.GitTag
func (notes *notesList) addTextNote(note string, repo *gitpb.Repo, refname string, cmd []string, line string) {
newnote := new(DeleteBranchNotes)
newnote.Note = note
- newnote.Refname = refname
+ newnote.Name = refname
newnote.Fullpath = repo.FullPath
newnote.Cmd = cmd
parts := strings.Split(line, "%00") // git log doesn't actually convert %00 to NULL
@@ -123,7 +123,7 @@ type notesList struct {
type DeleteBranchNotes struct {
Note string
- Refname string
+ Name string
Fullpath string
Cmd []string
// git log variable names
@@ -135,7 +135,7 @@ type DeleteBranchNotes struct {
// git branch -D refs/heads/jcarr
// git update-ref -d refs/heads/jcarr
-func doFixDeleteUserLocalBranch(repo *gitpb.Repo, remoteRef *gitpb.GitTag, localRef *gitpb.GitTag) (error, *notesList) {
+func doFixDeleteUserLocalBranch(repo *gitpb.Repo, remoteRef *gitpb.Stat, localRef *gitpb.Stat) (error, *notesList) {
notes := new(notesList)
// get local user, remote user & local devel branches
@@ -209,7 +209,7 @@ func doFixDeleteUserLocalBranch(repo *gitpb.Repo, remoteRef *gitpb.GitTag, local
// git push --delete origin jcarr
// git push origin :refs/remotes/origin/jcarr
-func doFixDeleteRemoteUserBranch(repo *gitpb.Repo, remoteRef *gitpb.GitTag) (error, *notesList) {
+func doFixDeleteRemoteUserBranch(repo *gitpb.Repo, remoteRef *gitpb.Stat) (error, *notesList) {
notes := new(notesList)
// get remote user & local devel branches
@@ -250,7 +250,7 @@ func doFixDeleteRemoteUserBranch(repo *gitpb.Repo, remoteRef *gitpb.GitTag) (err
}
// deletes local user branch if it's entirely in devel
-func doFixDeleteLocalUserByDevel(repo *gitpb.Repo, localRef *gitpb.GitTag) (error, *notesList) {
+func doFixDeleteLocalUserByDevel(repo *gitpb.Repo, localRef *gitpb.Stat) (error, *notesList) {
notes := new(notesList)
localUser := repo.NewCompareRef(localRef)
@@ -292,7 +292,7 @@ func doFixDeleteLocalUserByDevel(repo *gitpb.Repo, localRef *gitpb.GitTag) (erro
}
// deletes local user branch if it's entirely in master
-func doFixDeleteLocalUserByMaster(repo *gitpb.Repo, localRef *gitpb.GitTag) (error, *notesList) {
+func doFixDeleteLocalUserByMaster(repo *gitpb.Repo, localRef *gitpb.Stat) (error, *notesList) {
notes := new(notesList)
localUser := repo.NewCompareRef(localRef)
diff --git a/doNormal.go b/doNormal.go
index aed713a..e649731 100644
--- a/doNormal.go
+++ b/doNormal.go
@@ -205,10 +205,10 @@ func checkNormalRepoState(repo *gitpb.Repo) error {
return ErrorLocalMasterBranch
}
- if repo.Tags.Master == nil {
+ if repo.MasterStat == nil {
if found := repo.GetRemoteTag(repo.GetMasterBranchName()); found != nil {
// log.Info("found master tag ", repo.FullPath, found)
- repo.Tags.Master = proto.Clone(found).(*gitpb.GitTag)
+ repo.MasterStat = proto.Clone(found).(*gitpb.Stat)
config.SetChanged("repos", true)
} else {
log.Info("not found master tag (Reload() ?)", repo.FullPath)
diff --git a/doPull.go b/doPull.go
index a2e8026..7392749 100644
--- a/doPull.go
+++ b/doPull.go
@@ -17,7 +17,7 @@ func needToUpdateRepo(repo *gitpb.Repo) (*gitpb.Repo, error) {
if repo.Tags == nil {
return nil, nil
}
- if repo.Tags.Master == nil {
+ if repo.MasterStat == nil {
return nil, nil
}
found := me.forge.Repos.FindByNamespace(repo.Namespace)
@@ -27,12 +27,12 @@ func needToUpdateRepo(repo *gitpb.Repo) (*gitpb.Repo, error) {
if found.Tags == nil {
return nil, nil
}
- if found.Tags.Master == nil {
+ if found.MasterStat == nil {
return nil, nil
}
- newtime := repo.Tags.Master.Creatordate.AsTime()
- ourtime := found.Tags.Master.Creatordate.AsTime()
+ newtime := repo.MasterStat.CommitTime.AsTime()
+ ourtime := found.MasterStat.CommitTime.AsTime()
dur := newtime.Sub(ourtime)
if dur < time.Minute {
@@ -41,7 +41,7 @@ func needToUpdateRepo(repo *gitpb.Repo) (*gitpb.Repo, error) {
log.Infof("checking for updates %s %s\n", cobol.FormatDuration(dur), found.Namespace)
/*
dur := time.Since(repo.Tags.Master.Authordate.AsTime())
- when := repo.Tags.Master.Creatordate.AsTime()
+ when := repo.Tags.Master.CommitTime.AsTime()
dur = time.Since(when)
log.Infof("stuff %s age=%s %v\n", repo.Namespace, cobol.FormatDuration(dur), when)
*/
@@ -130,14 +130,14 @@ func doPull() (string, error) {
}
-func findGitTag(repo *gitpb.Repo, hash string) *gitpb.GitTag {
- for _, tag := range repo.Tags.GitTags {
+func findGitTag(repo *gitpb.Repo, hash string) *gitpb.Stat {
+ for _, tag := range repo.Tags.Stats {
if tag.Hash == hash {
return tag
}
// log.Info(i, tag.Hash, tag.Refname, tag)
}
- for i, tag := range repo.Tags.GitTags {
+ for i, tag := range repo.Tags.Stats {
log.Info(hash, i, tag)
}
okExit("")
diff --git a/doTag.go b/doTag.go
index 0d8bed2..09c22a6 100644
--- a/doTag.go
+++ b/doTag.go
@@ -83,15 +83,15 @@ func doTag() error {
return nil
}
-func makeTagTablePB(repo *gitpb.Repo, pb *gitpb.GitTags) *gitpb.GitTagsTable {
+func makeTagTablePB(repo *gitpb.Repo, pb *gitpb.Stats) *gitpb.StatsTable {
t := pb.NewTable("tagList")
t.NewUuid()
col := t.AddHash()
col.Width = 12
- col = t.AddStringFunc("bashash", func(tag *gitpb.GitTag) string {
- _, base := filepath.Split(tag.Refname)
+ col = t.AddStringFunc("bashash", func(tag *gitpb.Stat) string {
+ _, base := filepath.Split(tag.Name)
cmd, err := repo.RunStrict([]string{"git", "log", "-1", base, "--format=%H"})
if err != nil {
return "err"
@@ -103,20 +103,20 @@ func makeTagTablePB(repo *gitpb.Repo, pb *gitpb.GitTags) *gitpb.GitTagsTable {
})
col.Width = 12
- col = t.AddTimeFunc("ctime", func(tag *gitpb.GitTag) time.Time {
+ col = t.AddTimeFunc("ctime", func(tag *gitpb.Stat) time.Time {
// todo
- return tag.Creatordate.AsTime()
+ return tag.CommitTime.AsTime()
})
col.Width = 4
- col = t.AddTimeFunc("age", func(repo *gitpb.GitTag) time.Time {
+ col = t.AddTimeFunc("age", func(repo *gitpb.Stat) time.Time {
// todo
return time.Now()
})
col.Width = 4
- col = t.AddStringFunc("Ref Name", func(r *gitpb.GitTag) string {
- _, ref := filepath.Split(r.GetRefname())
+ col = t.AddStringFunc("Ref Name", func(r *gitpb.Stat) string {
+ _, ref := filepath.Split(r.GetName())
return ref
})
col.Width = 16
diff --git a/find.go b/find.go
index f3c84a4..44e100f 100644
--- a/find.go
+++ b/find.go
@@ -245,7 +245,7 @@ func cloneReposWithPatches() *gitpb.Repos {
stop += 1
if stop < 5 {
for t := range repo.Tags.IterAll() {
- log.Info("pb thinks it has:", repo.Namespace, t.Refname)
+ log.Info("pb thinks it has:", repo.Namespace, t.Name)
}
} else {
if argv.Fix {