summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--goDep.helpers.go6
-rw-r--r--goDep.parseGoSum.go10
-rw-r--r--goDep.redoGoMod.go4
-rw-r--r--isPrimitive.go2
-rw-r--r--reload.go2
-rw-r--r--repo.proto49
6 files changed, 37 insertions, 36 deletions
diff --git a/goDep.helpers.go b/goDep.helpers.go
index 271e67b..3fc3f21 100644
--- a/goDep.helpers.go
+++ b/goDep.helpers.go
@@ -8,12 +8,12 @@ import (
)
func (repo *Repo) DeleteGoDepByHash(hash string) {
- repo.GoDeps.DeleteByHash(hash)
+ repo.GoInfo.GoDeps.DeleteByHash(hash)
}
// enforces no duplicate package names
func (repo *Repo) AppendGoDep(newP *GoDep) bool {
- return repo.GoDeps.AppendByGoPath(newP)
+ return repo.GoInfo.GoDeps.AppendByGoPath(newP)
}
// returns time.Duration since last scan of go.sum & go.mod
@@ -24,5 +24,5 @@ func (repo *Repo) AgeGoDep() time.Duration {
// find a dependancy by the go path
func (repo *Repo) FindGoDepByPath(gopath string) *GoDep {
- return repo.GoDeps.FindByGoPath(gopath)
+ return repo.GoInfo.GoDeps.FindByGoPath(gopath)
}
diff --git a/goDep.parseGoSum.go b/goDep.parseGoSum.go
index c8a219f..f695c5a 100644
--- a/goDep.parseGoSum.go
+++ b/goDep.parseGoSum.go
@@ -18,7 +18,7 @@ import (
// this function isn't supposed to change anything, just parse the existing files
func (repo *Repo) ParseGoSum() bool {
// empty out what was there before
- repo.GoDeps = nil
+ repo.GoInfo.GoDeps = nil
// check of the repo is a primitive
// that means, there is not a go.sum file
@@ -55,10 +55,10 @@ func (repo *Repo) ParseGoSum() bool {
GoPath: godep,
Version: version,
}
- if repo.GoDeps == nil {
- repo.GoDeps = new(GoDeps)
+ if repo.GoInfo.GoDeps == nil {
+ repo.GoInfo.GoDeps = new(GoDeps)
}
- repo.GoDeps.AppendByGoPath(&new1)
+ repo.GoInfo.GoDeps.AppendByGoPath(&new1)
} else {
log.Info("gitpb.ParseGoSum() go.sum parse error invalid:", line)
return false
@@ -66,7 +66,7 @@ func (repo *Repo) ParseGoSum() bool {
}
if err := scanner.Err(); err != nil {
- repo.GoDeps = nil
+ repo.GoInfo.GoDeps = nil
log.Info("gitpb.ParseGoSum()", err)
return false
}
diff --git a/goDep.redoGoMod.go b/goDep.redoGoMod.go
index 908e088..6cba246 100644
--- a/goDep.redoGoMod.go
+++ b/goDep.redoGoMod.go
@@ -20,8 +20,8 @@ func (repo *Repo) ValidGoSum() error {
}
func (repo *Repo) GoDepsLen() int {
- if repo.GoDeps == nil {
+ if repo.GoInfo.GoDeps == nil {
return 0
}
- return len(repo.GoDeps.GoDeps)
+ return len(repo.GoInfo.GoDeps.GoDeps)
}
diff --git a/isPrimitive.go b/isPrimitive.go
index e935cec..0fb205c 100644
--- a/isPrimitive.go
+++ b/isPrimitive.go
@@ -65,6 +65,6 @@ func (repo *Repo) computePrimitive() (bool, error) {
}
}
repo.GoInfo.GoPrimitive = true
- repo.GoDeps = nil
+ repo.GoInfo.GoDeps = nil
return true, nil
}
diff --git a/reload.go b/reload.go
index d33ca25..47b5ed2 100644
--- a/reload.go
+++ b/reload.go
@@ -53,10 +53,10 @@ func (repo *Repo) ReloadForce() error {
repo.Tags = new(GitTags)
repo.reloadGitTags()
- repo.GoDeps = new(GoDeps)
if repo.GoInfo == nil {
repo.GoInfo = new(GoInfo)
}
+ repo.GoInfo.GoDeps = new(GoDeps)
repo.ParseGoSum() // also sets GoPrimitive
repo.reloadVersions()
repo.setRepoType()
diff --git a/repo.proto b/repo.proto
index f919a67..9381f9a 100644
--- a/repo.proto
+++ b/repo.proto
@@ -44,36 +44,37 @@ message GoInfo { // `autogenpb
}
message Repo { // `autogenpb:marshal` `autogenpb:nomutex`
- string namespace = 1; // `autogenpb:unique` `autogenpb:sort` // this repo is 'go.wit.com/lib/protobuf/gitpb'
- string fullPath = 2; // `autogenpb:unique` `autogenpb:sort` // the OS path to the .git directory: '/home/devel/golang.org/x/tools'
- string masterBranchName = 3; // git 'main' or 'master' branch name
- string develBranchName = 4; // whatever the git 'devel' branch name is
- string userBranchName = 5; // whatever your username branch is
- bool dirty = 6; // if git says things have been changed
- string URL = 7; // the URL
- GitTags tags = 8; // known tags
+ string uuid = 1; // `autogenpb:uuid:8daaeba1-fb1f-4762-ae6e-95a55d352673`
+ string namespace = 2; // `autogenpb:unique` `autogenpb:sort` // this repo is 'go.wit.com/lib/protobuf/gitpb'
+ string fullPath = 3; // `autogenpb:unique` `autogenpb:sort` // the OS path to the .git directory: '/home/devel/golang.org/x/tools'
+ string masterBranchName = 4; // git 'main' or 'master' branch name
+ string develBranchName = 5; // whatever the git 'devel' branch name is
+ string userBranchName = 6; // whatever your username branch is
+ bool dirty = 7; // if git says things have been changed
+ string URL = 8; // the URL
GitTimes times = 9; // store all the mtime values here. these are temporary
- GoInfo goInfo = 10; // put all the go specifcs here
- GoDeps goDeps = 11; // what is in the go.sum file
- string currentBranchName = 12; // the branch currently checked out
- string currentBranchVersion = 13; // the branch currently checked out
- string lastTag = 14; // the oldest tag
- string targetVersion = 15; // useful during the package release process
- bool readOnly = 16; // tracks access to 'git push'
- string desc = 17; // what is this repo?
- string stateChange = 18; // used for debugging tool logic
- string masterVersion = 19; // just store this for now
- string develVersion = 20; //
- string userVersion = 21; // `autogenpb:unique` `autogenpb:sort`
- repeated string dirtyList = 22; // store the list from git status --porcelain
- string state = 23; // status or state. useful for building tooling
+ string currentBranchName = 10; // the branch currently checked out
+ string currentBranchVersion = 11; // the branch currently checked out
+ string lastTag = 12; // the oldest tag
+ string targetVersion = 13; // useful during the package release process
+ bool readOnly = 14; // tracks access to 'git push'
+ string desc = 15; // what is this repo?
+ string stateChange = 16; // used for debugging tool logic
+ string masterVersion = 17; // just store this for now
+ string develVersion = 18; //
+ string userVersion = 19; // `autogenpb:unique` `autogenpb:sort`
+ repeated string dirtyList = 20; // store the list from git status --porcelain
+ string state = 21; // status or state. useful for building tooling
+ GitConfig config = 22; // protobuf of the current .git/config
+ GoInfo goInfo = 23; // put all the go specifcs here
GitTag currentTag = 24; // used to examine repo branches
- GitConfig config = 25; // protobuf of the current .git/config
+ GitTags tags = 25; // known tags
+ // GoDeps goDeps = 11; // what is in the go.sum file
}
message Repos { // `autogenpb:marshal` `autogenpb:sort` `autogenpb:gui` `autogenpb:nomutex` `autogenpb:http`
string uuid = 1; // `autogenpb:uuid:8daaeba1-fb1f-4762-ae6e-95a55d352673`
- string version = 2; // `autogenpb:version:v4`
+ string version = 2; // `autogenpb:version:v5`
repeated Repo repos = 3; // `autogenpb:append` // generate AppendUnique() function for this
bool hasFullScan = 4; // a full repo scan has been saved to disk
google.protobuf.Timestamp fullScan = 5; // mtime of the last full scan saved to disk