Documentation ¶
Overview ¶
Package execute provides reusable high-level functionality shared by all Git Town commands but doesn't have a place in other subsystems because it needs to use many subsystems together.
Index ¶
- func EnsureKnownBranchAncestry(branch gitdomain.LocalBranchName, args EnsureKnownBranchAncestryArgs) error
- func EnsureKnownBranchesAncestry(args EnsureKnownBranchesAncestryArgs) error
- func LoadRepoSnapshot(args LoadRepoSnapshotArgs) (gitdomain.BranchesSnapshot, gitdomain.StashSize, gitdomain.RepoStatus, bool, ...)
- type EnsureKnownBranchAncestryArgs
- type EnsureKnownBranchesAncestryArgs
- type FailureCollector
- func (self *FailureCollector) BranchInfos(value gitdomain.BranchInfos, err error) gitdomain.BranchInfos
- func (self *FailureCollector) Check(err error) bool
- func (self *FailureCollector) Fail(format string, a ...any)
- func (self *FailureCollector) Remotes(value gitdomain.Remotes, err error) gitdomain.Remotes
- type LoadRepoSnapshotArgs
- type OpenRepoArgs
- type OpenRepoResult
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EnsureKnownBranchAncestry ¶
func EnsureKnownBranchAncestry(branch gitdomain.LocalBranchName, args EnsureKnownBranchAncestryArgs) error
EnsureKnownBranchAncestry makes sure the lineage for the given branch is known. If needed, it queries the user for missing information. It returns the updated version of all information that is derived from the lineage.
The purpose of this function is to implement proper cache invalidation. It ensures that all information derived from lineage gets updated when the lineage is updated.
func EnsureKnownBranchesAncestry ¶
func EnsureKnownBranchesAncestry(args EnsureKnownBranchesAncestryArgs) error
EnsureKnownBranchesAncestry makes sure the entire repo lineage is known. If needed, it queries the user for missing information. It returns the updated version of all information that is derived from the lineage.
The purpose of this function is to implement proper cache invalidation. It ensures that all information derived from lineage gets updated when the lineage is updated.
func LoadRepoSnapshot ¶
func LoadRepoSnapshot(args LoadRepoSnapshotArgs) (gitdomain.BranchesSnapshot, gitdomain.StashSize, gitdomain.RepoStatus, bool, error)
LoadRepoSnapshot loads the initial snapshot of the Git repo.
Types ¶
type EnsureKnownBranchAncestryArgs ¶
type EnsureKnownBranchAncestryArgs struct { AllBranches gitdomain.BranchInfos Config *configdomain.FullConfig DefaultBranch gitdomain.LocalBranchName DialogTestInputs *components.TestInputs Runner *git.ProdRunner }
type EnsureKnownBranchesAncestryArgs ¶
type EnsureKnownBranchesAncestryArgs struct { Config *configdomain.FullConfig DialogTestInputs *components.TestInputs LocalBranches gitdomain.BranchInfos Runner *git.ProdRunner }
type FailureCollector ¶
type FailureCollector struct {
Err error `exhaustruct:"optional"`
}
FailureCollector helps avoid excessive error checking while gathering a larger number of values through fallible operations. This is based on ideas outlined in https://go.dev/blog/errors-are-values.
Please be aware that using this technique can lead to executing logic that would normally not run, using potentially invalid data, and potentially leading to unexpected runtime exceptions and side effects. Use with care and only if it's abundantly clear and obvious that there are no negative side effects. This is an anti-pattern in code to work arount an anti-pattern in the language.
func (*FailureCollector) BranchInfos ¶ added in v12.0.1
func (self *FailureCollector) BranchInfos(value gitdomain.BranchInfos, err error) gitdomain.BranchInfos
func (*FailureCollector) Check ¶
func (self *FailureCollector) Check(err error) bool
Check registers the given error and indicates whether this ErrorChecker contains an error now.
func (*FailureCollector) Fail ¶
func (self *FailureCollector) Fail(format string, a ...any)
Fail registers the error constructed using the given format arguments.
type LoadRepoSnapshotArgs ¶ added in v12.0.1
type LoadRepoSnapshotArgs struct { *configdomain.FullConfig DialogTestInputs components.TestInputs Fetch bool HandleUnfinishedState bool Repo *OpenRepoResult ValidateIsConfigured bool ValidateNoOpenChanges bool Verbose bool }
type OpenRepoArgs ¶
type OpenRepoResult ¶
type OpenRepoResult struct { ConfigSnapshot undoconfig.ConfigSnapshot IsOffline configdomain.Offline RootDir gitdomain.RepoRootDir Runner *git.ProdRunner }
func OpenRepo ¶
func OpenRepo(args OpenRepoArgs) (*OpenRepoResult, error)