Documentation ¶
Overview ¶
Package model provides the model of repository and commit. As long as another model that will be use in gitgo command.
Index ¶
- type Branch
- func (b *Branch) AskCreate(requireDesc, requireIter, requireIssue, issueHashtag bool) *Branch
- func (b *Branch) Checkout(ref *plumbing.Reference)
- func (b *Branch) CheckoutD()
- func (b *Branch) Create(name string) *Branch
- func (b *Branch) CurrentBranch() plumbing.ReferenceName
- func (b *Branch) Exist(name string) bool
- func (b *Branch) List(all bool, fn func(title string, i int, r *plumbing.Reference))
- func (b *Branch) NormalizeBranchName(name string) (newname string)
- func (b *Branch) SetDryrun(isDry bool)
- type BranchName
- type Commit
- type CommitMessage
- type CommitOption
- type CommitSettings
- type GitCommand
- type Header
- type List
- type Repo
- func (r *Repo) Add(filepath []string) (t *manager.Throwable)
- func (r *Repo) AddAll() *manager.Throwable
- func (r *Repo) GetBranch() *Branch
- func (r *Repo) GetCommit() *Commit
- func (r *Repo) GetGitRepository() *manager.ResultWrapper
- func (r *Repo) GetRawGitRepository() *git.Repository
- func (r *Repo) GetRawWorktree() *git.Worktree
- func (r *Repo) GetWorktree() *manager.ResultWrapper
- func (r *Repo) Setup()
- func (r *Repo) Status() *manager.ResultWrapper
- func (r *Repo) Throw() *manager.Throwable
- type YAML
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Branch ¶
type Branch struct { Repository *git.Repository Worktree *git.Worktree HEAD *plumbing.Reference Reference *plumbing.Reference KeyList *List // contains filtered or unexported fields }
func (*Branch) CurrentBranch ¶
func (b *Branch) CurrentBranch() plumbing.ReferenceName
func (*Branch) NormalizeBranchName ¶
NormalizeBranchName will make name as lower case and remove spacebar
type BranchName ¶
BranchName is the object the create branch name.
func (*BranchName) GetType ¶
func (b *BranchName) GetType() string
GetType will try to format the key to right way. Otherwise, return normal Key
func (*BranchName) Name ¶
func (b *BranchName) Name() string
type Commit ¶
type Commit struct { KeyList *List Settings *CommitSettings // contains filtered or unexported fields }
Commit is Commit object of deal with commit things.
func (*Commit) Commit ¶
func (c *Commit) Commit(key string, option CommitOption)
Commit is action for ask the message from user and call CustomCommit.
func (*Commit) CustomCommit ¶
func (c *Commit) CustomCommit(answers CommitMessage, option CommitOption)
CustomCommit will run git commit -m "<message>" with the default format.
func (*Commit) SetSettings ¶
type CommitMessage ¶
CommitMessage is the commit message for save in commit.
func (*CommitMessage) GetMessage ¶
func (c *CommitMessage) GetMessage() string
func (*CommitMessage) GetType ¶
func (c *CommitMessage) GetType() string
GetType will try to format the key to right way. Otherwise, return normal Key
type CommitOption ¶
CommitOption is a option of commit
type CommitSettings ¶
type GitCommand ¶
type GitCommand struct {
// contains filtered or unexported fields
}
GitCommand is git-cli command with custom stdout and custom stderr
func (*GitCommand) Exec ¶
func (g *GitCommand) Exec(args ...string) *manager.ErrManager
Exec will run git cli in command line
func (*GitCommand) SetErrWriter ¶
func (g *GitCommand) SetErrWriter(err io.Writer) *GitCommand
SetErrWriter will set err writer
func (*GitCommand) SetOutWriter ¶
func (g *GitCommand) SetOutWriter(out io.Writer) *GitCommand
SetOutWriter will set out writer
func (*GitCommand) SetReader ¶
func (g *GitCommand) SetReader(in io.Reader) *GitCommand
SetReader will set reader
type Repo ¶
type Repo struct {
// contains filtered or unexported fields
}
Repo is git repository object for gitgo.
func NewRepo ¶
func NewRepo() *Repo
NewRepo will return new repository with current path. you must call setup for load git repository to memory.
func (*Repo) Add ¶
Add get array of filepath, and return ErrManager. anyway, It's will run os.Exit with code 10 if any error occurred.
func (*Repo) AddAll ¶
func (r *Repo) AddAll() *manager.Throwable
AddAll will run git add -A command in cli.
func (*Repo) GetGitRepository ¶
func (r *Repo) GetGitRepository() *manager.ResultWrapper
GetGitRepository will return git.Repository of this Repo
func (*Repo) GetRawGitRepository ¶
func (r *Repo) GetRawGitRepository() *git.Repository
GetRawGitRepository will return git.Repository of this Repo, can be nil
func (*Repo) GetRawWorktree ¶
GetRawWorktree is getter to get worktree, this method can return nil value
func (*Repo) GetWorktree ¶
func (r *Repo) GetWorktree() *manager.ResultWrapper
GetWorktree is getter method, which get git.Worktree from git.Repository.
func (*Repo) Setup ¶
func (r *Repo) Setup()
Setup will load git repository to memory. If any error occurred, exit with code 5.
type YAML ¶
type YAML struct{}
YAML is object of config yaml
func (*YAML) ChgLogConfig ¶
func (*YAML) GDefaultConfig ¶
GDefaultConfig is global default config.yaml
func (*YAML) GDefaultList ¶
GDefaultList is global default list.yaml