augmented

package
v0.0.0-...-ba4a4a7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 10, 2022 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultBranchPriority = []string{"origin/main", "main", "origin/master", "master"}

Default branch priority determines parent child branch relations.

Functions

This section is empty.

Types

type Branch

type Branch struct {
	Name              string
	DisplayName       string
	TipID             string
	BottomID          string
	ParentBranch      *Branch
	IsRemote          bool
	RemoteName        string
	LocalName         string
	IsCurrent         bool
	IsGitBranch       bool
	IsAmbiguousBranch bool
	IsNamedBranch     bool
	IsSetAsParent     bool
	AmbiguousTipId    string
	AmbiguousBranches []*Branch
}

func (*Branch) BaseName

func (t *Branch) BaseName() string

func (*Branch) GetAncestors

func (t *Branch) GetAncestors() []*Branch

func (*Branch) GetAncestorsAndSelf

func (t *Branch) GetAncestorsAndSelf() []*Branch

func (*Branch) IsAncestorBranch

func (t *Branch) IsAncestorBranch(name string) bool

func (*Branch) IsSame

func (t *Branch) IsSame(branch *Branch) bool

func (*Branch) String

func (t *Branch) String() string

type Commit

type Commit struct {
	Id         string
	Sid        string
	Subject    string
	Message    string
	Author     string
	AuthorTime time.Time
	ParentIDs  []string

	IsCurrent      bool
	ChildIDs       []string
	FirstParent    *Commit
	MergeParent    *Commit
	Children       []*Commit
	MergeChildren  []*Commit
	Branch         *Branch
	Branches       []*Branch
	BranchTipNames []string

	IsAmbiguous    bool
	IsAmbiguousTip bool
	// contains filtered or unexported fields
}

func (*Commit) String

func (c *Commit) String() string

type Ignorer

type Ignorer interface {
	IsIgnored(path string) bool
}

type MetaData

type MetaData struct {
	BranchesChildren map[string][]string
}

type Repo

type Repo struct {
	Commits []*Commit

	Branches []*Branch
	Status   Status
	Tags     []Tag
	RepoPath string
	MetaData MetaData
	// contains filtered or unexported fields
}

func (*Repo) BranchByName

func (r *Repo) BranchByName(name string) (*Branch, bool)

func (*Repo) CommitByID

func (r *Repo) CommitByID(id string) *Commit

func (*Repo) CurrentBranch

func (r *Repo) CurrentBranch() (*Branch, bool)

func (*Repo) Parent

func (r *Repo) Parent(commit *Commit, index int) (*Commit, bool)

func (Repo) SearchCommits

func (r Repo) SearchCommits(searchText string) []*Commit

func (*Repo) TryGetCommitByID

func (r *Repo) TryGetCommitByID(id string) (*Commit, bool)

type RepoChange

type RepoChange struct {
	IsStarting bool
	Repo       Repo
	Error      error
}

type RepoService

type RepoService interface {
	Git() git.Git
	RepoChanges() chan RepoChange
	RepoPath() string
	TriggerManualRefresh()

	StartMonitor(ctx context.Context)

	GetCommitDiff(id string) (git.CommitDiff, error)
	GetFileDiff(path string) ([]git.CommitDiff, error)
	GetFiles(ref string) ([]string, error)

	SwitchToBranch(name string) error
	Commit(commit string) error
	PushBranch(name string) error
	CreateBranch(name string, parentBranch *Branch) error
	MergeBranch(name string) error
	DeleteRemoteBranch(name string) error
	DeleteLocalBranch(name string, isForced bool) error
	PullCurrentBranch() error
	PullBranch(name string) error

	GetFreshRepo() (Repo, error)
	SetAsParentBranch(b *Branch, pb *Branch) error
	UnsetAsParentBranch(name string) error
	UndoCommit(id string) error
	UncommitLastCommit() error
	UndoAllUncommittedChanges() error
	UndoUncommittedFileChanges(path string) error
	CleanWorkingFolder() error
}

func NewRepoService

func NewRepoService(rootPath string) RepoService

type Status

type Status struct {
	Modified     int
	Added        int
	Deleted      int
	Conflicted   int
	IsMerging    bool
	MergeMessage string
}

func (Status) AllChanges

func (s Status) AllChanges() int

func (Status) OK

func (s Status) OK() bool

func (*Status) String

func (s *Status) String() string

type Tag

type Tag struct {
	CommitID string
	TagName  string
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL