Documentation
¶
Index ¶
- Variables
- func Clone(wdir string, path string) error
- func Exists(file string) bool
- func IsDirectory(path string) bool
- func IsGitDir(dir string) bool
- func ListAllOld()
- func ListGitDirectories() []string
- func RunCmd(workingpath string, parts []string) (error, bool, string)
- func ScanGitDirectories(srcDir string) []string
- func SetWorkPath(path string)
- type GitConfig
- type GitTagBox
- type GoConfig
- type Module
- type ModuleError
- type Origin
- type RepoStatus
- func (rs *RepoStatus) Age() time.Duration
- func (rs *RepoStatus) BinaryName() string
- func (rs *RepoStatus) BranchExists(branch string) bool
- func (rs *RepoStatus) Build() bool
- func (rs *RepoStatus) Changed() (string, bool)
- func (rs *RepoStatus) CheckBranches() bool
- func (rs *RepoStatus) CheckDirty() bool
- func (rs *RepoStatus) CheckGitState() string
- func (rs *RepoStatus) CheckoutBranch(bname string) bool
- func (rs *RepoStatus) CheckoutDevel() bool
- func (rs *RepoStatus) CheckoutMaster() bool
- func (rs *RepoStatus) CheckoutUser() bool
- func (rs *RepoStatus) DebianCurrentVersion() string
- func (rs *RepoStatus) DebianReleaseVersion() string
- func (rs *RepoStatus) DeleteTag(rt *Tag)
- func (rs *RepoStatus) DeleteUserBranch(force bool) bool
- func (rs *RepoStatus) Disable()
- func (rs *RepoStatus) DisableEverything()
- func (rs *RepoStatus) DoAll(all [][]string) bool
- func (rs *RepoStatus) DumpTags()
- func (rs *RepoStatus) Enable()
- func (rs *RepoStatus) EnableMergeDevel()
- func (rs *RepoStatus) EnableSelectTag()
- func (rs *RepoStatus) Exists(filename string) bool
- func (rs *RepoStatus) FetchDevel() (error, string)
- func (rs *RepoStatus) FetchMaster() (error, string)
- func (rs *RepoStatus) FullPath() string
- func (rs *RepoStatus) GetCurrentBranchName() string
- func (rs *RepoStatus) GetCurrentBranchVersion() string
- func (rs *RepoStatus) GetCurrentVersion() string
- func (rs *RepoStatus) GetDevelBranchName() string
- func (rs *RepoStatus) GetDevelVersion() string
- func (rs *RepoStatus) GetGoDeps() GoConfig
- func (rs *RepoStatus) GetLastTagVersion() string
- func (rs *RepoStatus) GetMasterBranchName() string
- func (rs *RepoStatus) GetMasterVersion() string
- func (rs *RepoStatus) GetNewVersionTag() string
- func (rs *RepoStatus) GetStatus() string
- func (rs *RepoStatus) GetTargetVersion() string
- func (rs *RepoStatus) GetUserBranchName() string
- func (rs *RepoStatus) GetUserVersion() string
- func (rs *RepoStatus) GitLsFiles() (bool, string)
- func (rs *RepoStatus) GitPull() (string, error)
- func (rs *RepoStatus) GitState() string
- func (rs *RepoStatus) GitURL() string
- func (rs *RepoStatus) GoConfig() map[string]string
- func (rs *RepoStatus) GoName() string
- func (rs *RepoStatus) GoPath() string
- func (rs *RepoStatus) Hide()
- func (rs *RepoStatus) IncrementMinorVersion(reason string)
- func (rs *RepoStatus) IncrementRevisionVersion(reason string)
- func (rs *RepoStatus) IncrementVersion() bool
- func (rs *RepoStatus) IsCorrectMode(mode string) bool
- func (rs *RepoStatus) IsDirty() bool
- func (rs *RepoStatus) IsGoLang() bool
- func (rs *RepoStatus) IsOnlyLocalTag(taggy string) bool
- func (rs *RepoStatus) IsPrimitive() bool
- func (rs *RepoStatus) IsPrivate() bool
- func (rs *RepoStatus) IsReleased() bool
- func (rs *RepoStatus) IsUserBranch() bool
- func (rs *RepoStatus) LastGitPull() (time.Time, error)
- func (rs *RepoStatus) LastTag() string
- func (rs *RepoStatus) LocalTagExists(findname string) bool
- func (rs *RepoStatus) MakeRedomod() (bool, error)
- func (rs *RepoStatus) MergeDevelToMaster() bool
- func (rs *RepoStatus) MergeUserToDevel() bool
- func (rs *RepoStatus) MirrorCurrentName() *gui.Node
- func (rs *RepoStatus) MirrorCurrentVersion() *gui.Node
- func (rs *RepoStatus) MirrorDevelVersion() *gui.Node
- func (rs *RepoStatus) MirrorGitState() *gui.Node
- func (rs *RepoStatus) MirrorLastTag() *gui.Node
- func (rs *RepoStatus) MirrorMasterVersion() *gui.Node
- func (rs *RepoStatus) MirrorTargetVersion() *gui.Node
- func (rs *RepoStatus) MirrorUserVersion() *gui.Node
- func (rs *RepoStatus) Name() string
- func (rs *RepoStatus) NewestTag() *Tag
- func (rs *RepoStatus) NoteChange(s string)
- func (rs *RepoStatus) Path() string
- func (rs *RepoStatus) ReadOnly() bool
- func (rs *RepoStatus) Ready() bool
- func (rs *RepoStatus) RepoType() string
- func (rs *RepoStatus) ResetBranches() bool
- func (rs *RepoStatus) RevertMasterToDevel() bool
- func (rs *RepoStatus) RunCmd(parts []string) (error, string)
- func (rs *RepoStatus) RunCmdEcho(parts []string) (error, string)
- func (rs *RepoStatus) SetPrivate(b bool)
- func (rs *RepoStatus) SetReadOnly(b bool)
- func (ls *RepoStatus) SetSpeedActual(s string)
- func (rs *RepoStatus) SetTargetVersion(s string)
- func (rs *RepoStatus) SetVersion(a, b, c string, reason string)
- func (rs *RepoStatus) Show()
- func (rs *RepoStatus) String() string
- func (rs *RepoStatus) TagExists(findname string) bool
- func (rs *RepoStatus) Toggle()
- func (rs *RepoStatus) Update()
- func (rs *RepoStatus) Xterm(cmdline string)
- func (rs *RepoStatus) XtermBash(args []string)
- func (rs *RepoStatus) XtermNohup(cmdline string)
- func (rs *RepoStatus) XtermWait(cmdline string)
- type Tag
Constants ¶
This section is empty.
Variables ¶
var CHANGE *log.LogFlag
var ErrorGitPullOnLocal error = errors.New("git pull on local only branch")
var ErrorMissingGitConfig error = errors.New("missing .git/config")
var INFO *log.LogFlag
var REPO *log.LogFlag
var REPOWARN *log.LogFlag
var WARN *log.LogFlag
Functions ¶
func IsDirectory ¶
func IsGitDir ¶ added in v0.21.2
IsGitDir checks if a .git directory exists inside the given directory
func ListGitDirectories ¶ added in v0.13.2
func ListGitDirectories() []string
func ScanGitDirectories ¶ added in v0.22.1
func SetWorkPath ¶ added in v0.22.1
func SetWorkPath(path string)
Types ¶
type GitConfig ¶ added in v0.13.1
type GitConfig struct {
// contains filtered or unexported fields
}
type GitTagBox ¶ added in v0.20.8
type GitTagBox struct {
// contains filtered or unexported fields
}
a GUI box of all the tags in a repo
func (*GitTagBox) PruneSmart ¶ added in v0.20.8
func (rtags *GitTagBox) PruneSmart()
hide tags worth keeping
type Module ¶ added in v0.22.5
type Module struct { Path string // module path Query string // version query corresponding to this version Version string // module version Versions []string // available module versions Replace *Module // replaced by this module Time *time.Time // time version was created Update *Module // available update (with -u) Main bool // is this the main module? Indirect bool // module is only indirectly needed by main module Dir string // directory holding local copy of files, if any GoMod string // path to go.mod file describing module, if any GoVersion string // go version used in module Retracted []string // retraction information, if any (with -retracted or -u) Deprecated string // deprecation message, if any (with -u) Error *ModuleError // error loading module Sum string // checksum for path, version (as in go.sum) GoModSum string // checksum for go.mod (as in go.sum) Reuse bool // reuse of old module info is safe Origin Origin }
type ModuleError ¶ added in v0.22.5
type ModuleError struct {
Err string // the error itself
}
type Origin ¶ added in v0.22.5
type Origin struct { VCS string `json:",omitempty"` // "git" etc URL string `json:",omitempty"` // URL of repository Subdir string `json:",omitempty"` // subdirectory in repo Hash string `json:",omitempty"` // commit hash or ID // If TagSum is non-empty, then the resolution of this module version // depends on the set of tags present in the repo, specifically the tags // of the form TagPrefix + a valid semver version. // If the matching repo tags and their commit hashes still hash to TagSum, // the Origin is still valid (at least as far as the tags are concerned). // The exact checksum is up to the Repo implementation; see (*gitRepo).Tags. TagPrefix string `json:",omitempty"` TagSum string `json:",omitempty"` // If Ref is non-empty, then the resolution of this module version // depends on Ref resolving to the revision identified by Hash. // If Ref still resolves to Hash, the Origin is still valid (at least as far as Ref is concerned). // For Git, the Ref is a full ref like "refs/heads/main" or "refs/tags/v1.2.3", // and the Hash is the Git object hash the ref maps to. // Other VCS might choose differently, but the idea is that Ref is the name // with a mutable meaning while Hash is a name with an immutable meaning. Ref string `json:",omitempty"` // If RepoSum is non-empty, then the resolution of this module version // failed due to the repo being available but the version not being present. // This depends on the entire state of the repo, which RepoSum summarizes. // For Git, this is a hash of all the refs and their hashes. RepoSum string `json:",omitempty"` }
An Origin describes the provenance of a given repo method result. It can be passed to CheckReuse (usually in a different go command invocation) to see whether the result remains up-to-date.
type RepoStatus ¶
type RepoStatus struct { Tags *GitTagBox // a box of all the git tags // contains filtered or unexported fields }
func FindPathOld ¶ added in v0.20.8
func FindPathOld(path string) *RepoStatus
returns the object for the path deprecate this
func New ¶
func New(path string) (*RepoStatus, error)
makes a window of the status of the repo don't worry, you can think of it like Sierpinski carpet it's doesn't need to be displayed so it'll work fine even in an embedded space
func NewRepoStatusWindow ¶ added in v0.12.20
func NewRepoStatusWindow(path string) (error, *RepoStatus)
func (*RepoStatus) Age ¶ added in v0.20.9
func (rs *RepoStatus) Age() time.Duration
func (*RepoStatus) BinaryName ¶ added in v0.20.4
func (rs *RepoStatus) BinaryName() string
func (*RepoStatus) BranchExists ¶ added in v0.20.9
func (rs *RepoStatus) BranchExists(branch string) bool
func (*RepoStatus) Build ¶ added in v0.20.4
func (rs *RepoStatus) Build() bool
func (*RepoStatus) Changed ¶
func (rs *RepoStatus) Changed() (string, bool)
reports externally if something has changed since the last time it was asked about it
func (*RepoStatus) CheckBranches ¶
func (rs *RepoStatus) CheckBranches() bool
actually, this is to attempt to verify absolutely everything is pushed upstream before doing a rm -rf ~/go/src TODO: revisit this code in the autotypist later
func (*RepoStatus) CheckDirty ¶
func (rs *RepoStatus) CheckDirty() bool
func (*RepoStatus) CheckGitState ¶ added in v0.20.8
func (rs *RepoStatus) CheckGitState() string
func (*RepoStatus) CheckoutBranch ¶
func (rs *RepoStatus) CheckoutBranch(bname string) bool
func (*RepoStatus) CheckoutDevel ¶ added in v0.20.3
func (rs *RepoStatus) CheckoutDevel() bool
func (*RepoStatus) CheckoutMaster ¶ added in v0.17.0
func (rs *RepoStatus) CheckoutMaster() bool
func (*RepoStatus) CheckoutUser ¶ added in v0.20.8
func (rs *RepoStatus) CheckoutUser() bool
func (*RepoStatus) DebianCurrentVersion ¶ added in v0.21.4
func (rs *RepoStatus) DebianCurrentVersion() string
func (*RepoStatus) DebianReleaseVersion ¶ added in v0.21.4
func (rs *RepoStatus) DebianReleaseVersion() string
func (*RepoStatus) DeleteTag ¶ added in v0.20.8
func (rs *RepoStatus) DeleteTag(rt *Tag)
deleting it locally triggers some but when the git server was uncontactable (over IPv6 if that matters, probably it doesn't) and then the local delete re-added it into the tag
func (*RepoStatus) DeleteUserBranch ¶ added in v0.21.1
func (rs *RepoStatus) DeleteUserBranch(force bool) bool
func (*RepoStatus) Disable ¶ added in v0.12.17
func (rs *RepoStatus) Disable()
func (*RepoStatus) DisableEverything ¶
func (rs *RepoStatus) DisableEverything()
disable all things besides Update() button
func (*RepoStatus) DoAll ¶ added in v0.20.4
func (rs *RepoStatus) DoAll(all [][]string) bool
func (*RepoStatus) DumpTags ¶ added in v0.21.1
func (rs *RepoStatus) DumpTags()
func (*RepoStatus) Enable ¶ added in v0.12.17
func (rs *RepoStatus) Enable()
func (*RepoStatus) EnableMergeDevel ¶
func (rs *RepoStatus) EnableMergeDevel()
this means devel needs to be merged to master
func (*RepoStatus) EnableSelectTag ¶
func (rs *RepoStatus) EnableSelectTag()
this means you need to release a new version of the master repository
func (*RepoStatus) Exists ¶ added in v0.20.1
func (rs *RepoStatus) Exists(filename string) bool
func (*RepoStatus) FetchDevel ¶ added in v0.21.1
func (rs *RepoStatus) FetchDevel() (error, string)
func (*RepoStatus) FetchMaster ¶ added in v0.21.1
func (rs *RepoStatus) FetchMaster() (error, string)
func (*RepoStatus) GetCurrentBranchName ¶
func (rs *RepoStatus) GetCurrentBranchName() string
func (*RepoStatus) GetCurrentBranchVersion ¶
func (rs *RepoStatus) GetCurrentBranchVersion() string
func (*RepoStatus) GetCurrentVersion ¶ added in v0.20.8
func (rs *RepoStatus) GetCurrentVersion() string
func (*RepoStatus) GetDevelBranchName ¶ added in v0.12.17
func (rs *RepoStatus) GetDevelBranchName() string
func (*RepoStatus) GetDevelVersion ¶
func (rs *RepoStatus) GetDevelVersion() string
func (*RepoStatus) GetGoDeps ¶ added in v0.16.0
func (rs *RepoStatus) GetGoDeps() GoConfig
func (*RepoStatus) GetLastTagVersion ¶
func (rs *RepoStatus) GetLastTagVersion() string
func (*RepoStatus) GetMasterBranchName ¶ added in v0.12.17
func (rs *RepoStatus) GetMasterBranchName() string
returns "master", "devel", os.Username, etc
func (*RepoStatus) GetMasterVersion ¶
func (rs *RepoStatus) GetMasterVersion() string
returns the git versions like "1.3-2-laksdjf" or whatever
func (*RepoStatus) GetNewVersionTag ¶ added in v0.20.9
func (rs *RepoStatus) GetNewVersionTag() string
the newversion field goes through some sanity checking to make sure it's greater than the existing tag and valid according to golang -- it must be format 'v1.2.3'
func (*RepoStatus) GetStatus ¶ added in v0.12.17
func (rs *RepoStatus) GetStatus() string
func (*RepoStatus) GetTargetVersion ¶ added in v0.20.8
func (rs *RepoStatus) GetTargetVersion() string
func (*RepoStatus) GetUserBranchName ¶ added in v0.12.17
func (rs *RepoStatus) GetUserBranchName() string
func (*RepoStatus) GetUserVersion ¶
func (rs *RepoStatus) GetUserVersion() string
func (*RepoStatus) GitLsFiles ¶ added in v0.20.0
func (rs *RepoStatus) GitLsFiles() (bool, string)
func (*RepoStatus) GitPull ¶ added in v0.20.9
func (rs *RepoStatus) GitPull() (string, error)
func (*RepoStatus) GitState ¶ added in v0.20.8
func (rs *RepoStatus) GitState() string
func (*RepoStatus) GitURL ¶ added in v0.20.4
func (rs *RepoStatus) GitURL() string
func (*RepoStatus) GoConfig ¶ added in v0.20.8
func (rs *RepoStatus) GoConfig() map[string]string
func (*RepoStatus) GoName ¶ added in v0.20.8
func (rs *RepoStatus) GoName() string
returns the go path for the repo. "go.wit.com/apps/autotypist"
func (*RepoStatus) GoPath ¶ added in v0.20.8
func (rs *RepoStatus) GoPath() string
not sure which name is easier to remember. probably this one
func (*RepoStatus) Hide ¶
func (rs *RepoStatus) Hide()
func (*RepoStatus) IncrementMinorVersion ¶ added in v0.22.0
func (rs *RepoStatus) IncrementMinorVersion(reason string)
func (*RepoStatus) IncrementRevisionVersion ¶ added in v0.22.0
func (rs *RepoStatus) IncrementRevisionVersion(reason string)
func (*RepoStatus) IncrementVersion ¶ added in v0.20.8
func (rs *RepoStatus) IncrementVersion() bool
func (*RepoStatus) IsCorrectMode ¶ added in v0.21.1
func (rs *RepoStatus) IsCorrectMode(mode string) bool
func (*RepoStatus) IsDirty ¶ added in v0.20.8
func (rs *RepoStatus) IsDirty() bool
returns quickly based on the last time it was checked
func (*RepoStatus) IsGoLang ¶ added in v0.20.8
func (rs *RepoStatus) IsGoLang() bool
func (*RepoStatus) IsOnlyLocalTag ¶ added in v0.21.1
func (rs *RepoStatus) IsOnlyLocalTag(taggy string) bool
returns true if 'taggy' is _ONLY_ a local tag this means you can not do a git pull or git push on it
func (*RepoStatus) IsPrimitive ¶ added in v0.20.8
func (rs *RepoStatus) IsPrimitive() bool
func (*RepoStatus) IsPrivate ¶ added in v0.20.10
func (rs *RepoStatus) IsPrivate() bool
func (*RepoStatus) IsReleased ¶ added in v0.20.8
func (rs *RepoStatus) IsReleased() bool
func (*RepoStatus) IsUserBranch ¶ added in v0.21.1
func (rs *RepoStatus) IsUserBranch() bool
used to block commits on non-user branches
func (*RepoStatus) LastGitPull ¶ added in v0.20.9
func (rs *RepoStatus) LastGitPull() (time.Time, error)
func (*RepoStatus) LastTag ¶ added in v0.20.9
func (rs *RepoStatus) LastTag() string
func (*RepoStatus) LocalTagExists ¶ added in v0.20.8
func (rs *RepoStatus) LocalTagExists(findname string) bool
func (*RepoStatus) MakeRedomod ¶ added in v0.13.2
func (rs *RepoStatus) MakeRedomod() (bool, error)
poor name perhaps. It's because in most of these repos you can also type "make redomod" to do the same thing since it's a Makefile task that is also useful to be able to run from the command line
func (*RepoStatus) MergeDevelToMaster ¶ added in v0.20.8
func (rs *RepoStatus) MergeDevelToMaster() bool
func (*RepoStatus) MergeUserToDevel ¶ added in v0.20.8
func (rs *RepoStatus) MergeUserToDevel() bool
func (*RepoStatus) MirrorCurrentName ¶ added in v0.20.8
func (rs *RepoStatus) MirrorCurrentName() *gui.Node
func (*RepoStatus) MirrorCurrentVersion ¶ added in v0.20.8
func (rs *RepoStatus) MirrorCurrentVersion() *gui.Node
func (*RepoStatus) MirrorDevelVersion ¶ added in v0.20.8
func (rs *RepoStatus) MirrorDevelVersion() *gui.Node
func (*RepoStatus) MirrorGitState ¶ added in v0.20.8
func (rs *RepoStatus) MirrorGitState() *gui.Node
func (*RepoStatus) MirrorLastTag ¶ added in v0.20.8
func (rs *RepoStatus) MirrorLastTag() *gui.Node
returns a widget of the last tag that acts as a mirror
func (*RepoStatus) MirrorMasterVersion ¶ added in v0.20.8
func (rs *RepoStatus) MirrorMasterVersion() *gui.Node
func (*RepoStatus) MirrorTargetVersion ¶ added in v0.20.8
func (rs *RepoStatus) MirrorTargetVersion() *gui.Node
func (*RepoStatus) MirrorUserVersion ¶ added in v0.20.8
func (rs *RepoStatus) MirrorUserVersion() *gui.Node
func (*RepoStatus) Name ¶ added in v0.21.1
func (rs *RepoStatus) Name() string
returns a name for human consuption only todo: implement nicknames
func (*RepoStatus) NewestTag ¶ added in v0.20.9
func (rs *RepoStatus) NewestTag() *Tag
func (*RepoStatus) NoteChange ¶ added in v0.20.8
func (rs *RepoStatus) NoteChange(s string)
func (*RepoStatus) Path ¶ added in v0.20.8
func (rs *RepoStatus) Path() string
returns the filesystem path to the repo
func (*RepoStatus) ReadOnly ¶ added in v0.13.2
func (rs *RepoStatus) ReadOnly() bool
func (*RepoStatus) Ready ¶
func (rs *RepoStatus) Ready() bool
func (*RepoStatus) RepoType ¶ added in v0.20.4
func (rs *RepoStatus) RepoType() string
experiment to go package type
func (*RepoStatus) ResetBranches ¶ added in v0.21.1
func (rs *RepoStatus) ResetBranches() bool
func (*RepoStatus) RevertMasterToDevel ¶ added in v0.20.4
func (rs *RepoStatus) RevertMasterToDevel() bool
reverts master to devel used in the unwind process of making GUI releases
func (*RepoStatus) RunCmd ¶ added in v0.13.2
func (rs *RepoStatus) RunCmd(parts []string) (error, string)
func (*RepoStatus) RunCmdEcho ¶ added in v0.20.8
func (rs *RepoStatus) RunCmdEcho(parts []string) (error, string)
func (*RepoStatus) SetPrivate ¶ added in v0.20.10
func (rs *RepoStatus) SetPrivate(b bool)
func (*RepoStatus) SetReadOnly ¶ added in v0.20.10
func (rs *RepoStatus) SetReadOnly(b bool)
func (*RepoStatus) SetSpeedActual ¶
func (ls *RepoStatus) SetSpeedActual(s string)
func (*RepoStatus) SetTargetVersion ¶ added in v0.20.8
func (rs *RepoStatus) SetTargetVersion(s string)
TODO: run this through the sanity check!
func (*RepoStatus) SetVersion ¶ added in v0.13.1
func (rs *RepoStatus) SetVersion(a, b, c string, reason string)
func (*RepoStatus) Show ¶
func (rs *RepoStatus) Show()
func (*RepoStatus) String ¶
func (rs *RepoStatus) String() string
deprecate this. returns the gopath right now
func (*RepoStatus) TagExists ¶ added in v0.20.8
func (rs *RepoStatus) TagExists(findname string) bool
func (*RepoStatus) Toggle ¶
func (rs *RepoStatus) Toggle()
func (*RepoStatus) Update ¶
func (rs *RepoStatus) Update()
func (*RepoStatus) Xterm ¶ added in v0.20.4
func (rs *RepoStatus) Xterm(cmdline string)
func (*RepoStatus) XtermBash ¶ added in v0.20.8
func (rs *RepoStatus) XtermBash(args []string)
func (*RepoStatus) XtermNohup ¶ added in v0.20.4
func (rs *RepoStatus) XtermNohup(cmdline string)
func (*RepoStatus) XtermWait ¶ added in v0.20.8
func (rs *RepoStatus) XtermWait(cmdline string)