Documentation ¶
Index ¶
- Constants
- func VerifyInGitRepo(osCommand *oscommands.OSCommand) error
- type BranchListBuilder
- type CheckoutOptions
- type CommitListBuilder
- type FetchOptions
- type FileStatus
- type GetCommitsOptions
- type GetStatusFileOptions
- type GitCommand
- func (c *GitCommand) AbortMerge() error
- func (c *GitCommand) AddRemote(name string, url string) error
- func (c *GitCommand) AmendHead() error
- func (c *GitCommand) AmendHeadCmdStr() string
- func (c *GitCommand) AmendTo(sha string) error
- func (c *GitCommand) ApplyPatch(patch string, flags ...string) error
- func (c *GitCommand) BeforeAndAfterFileForRename(file *models.File) (*models.File, *models.File, error)
- func (c *GitCommand) BeginInteractiveRebaseForCommit(commits []*models.Commit, commitIndex int) error
- func (c *GitCommand) CatFile(fileName string) (string, error)
- func (c *GitCommand) CheckRemoteBranchExists(branchName string) bool
- func (c *GitCommand) Checkout(branch string, options CheckoutOptions) error
- func (c *GitCommand) CheckoutFile(commitSha, fileName string) error
- func (c *GitCommand) CherryPickCommits(commits []*models.Commit) error
- func (c *GitCommand) CommitCmdStr(message string, flags string) string
- func (c *GitCommand) ConfiguredPager() string
- func (c *GitCommand) CreateFixupCommit(sha string) error
- func (c *GitCommand) CreateLightweightTag(tagName string, commitSha string) error
- func (c *GitCommand) CurrentBranchName() (string, string, error)
- func (c *GitCommand) DeleteBranch(branch string, force bool) error
- func (c *GitCommand) DeletePatchesFromCommit(commits []*models.Commit, commitIndex int, p *patch.PatchManager) error
- func (c *GitCommand) DeleteRemoteBranch(remoteName string, branchName string, ...) error
- func (c *GitCommand) DeleteTag(tagName string) error
- func (c *GitCommand) DetectUnamePass(cmdObj oscommands.ICmdObj, promptUserForCredential func(string) string) error
- func (c *GitCommand) DiscardAllDirChanges(node *filetree.FileNode) error
- func (c *GitCommand) DiscardAllFileChanges(file *models.File) error
- func (c *GitCommand) DiscardAnyUnstagedFileChanges() error
- func (c *GitCommand) DiscardOldFileChanges(commits []*models.Commit, commitIndex int, fileName string) error
- func (c *GitCommand) DiscardUnstagedDirChanges(node *filetree.FileNode) error
- func (c *GitCommand) DiscardUnstagedFileChanges(file *models.File) error
- func (c *GitCommand) EditFileCmdStr(filename string, lineNumber int) (string, error)
- func (c *GitCommand) EditRebaseTodo(index int, action string) error
- func (c *GitCommand) FastForward(branchName string, remoteName string, remoteBranchName string, ...) error
- func (c *GitCommand) Fetch(opts FetchOptions) error
- func (c *GitCommand) FetchRemote(remoteName string, promptUserForCredential func(string) string) error
- func (c *GitCommand) GenerateGenericRebaseTodo(commits []*models.Commit, actionIndex int, action string) (string, string, error)
- func (c *GitCommand) GenericMergeOrRebaseAction(commandType string, command string) error
- func (c *GitCommand) GetBranchGraph(branchName string) (string, error)
- func (c *GitCommand) GetBranchGraphCmdStr(branchName string) string
- func (c *GitCommand) GetBranchUpstreamDifferenceCount(branchName string) (string, string)
- func (c *GitCommand) GetCommitDifferences(from, to string) (string, string)
- func (c *GitCommand) GetCommitMessage(commitSha string) (string, error)
- func (c *GitCommand) GetCommitMessageFirstLine(sha string) (string, error)
- func (c *GitCommand) GetCurrentBranchUpstreamDifferenceCount() (string, string)
- func (c *GitCommand) GetFilesInDiff(from string, to string, reverse bool) ([]*models.CommitFile, error)
- func (c *GitCommand) GetHeadCommitMessage() (string, error)
- func (c *GitCommand) GetPager(width int) string
- func (c *GitCommand) GetReflogCommits(lastReflogCommit *models.Commit, filterPath string) ([]*models.Commit, bool, error)
- func (c *GitCommand) GetRemoteURL() string
- func (c *GitCommand) GetRemotes() ([]*models.Remote, error)
- func (c *GitCommand) GetStashEntries(filterPath string) []*models.StashEntry
- func (c *GitCommand) GetStatusFiles(opts GetStatusFileOptions) []*models.File
- func (c *GitCommand) GetSubmoduleConfigs() ([]*models.SubmoduleConfig, error)
- func (c *GitCommand) GetTags() ([]*models.Tag, error)
- func (c *GitCommand) GetUpstreamForBranch(branchName string) (string, error)
- func (c *GitCommand) GitStatus(opts GitStatusOptions) ([]FileStatus, error)
- func (c *GitCommand) Ignore(filename string) error
- func (c *GitCommand) InteractiveRebase(commits []*models.Commit, index int, action string) error
- func (c *GitCommand) IsBareRepo() bool
- func (c *GitCommand) IsHeadDetached() bool
- func (c *GitCommand) IsInMergeState() (bool, error)
- func (c *GitCommand) Merge(branchName string, opts MergeOpts) error
- func (c *GitCommand) MoveCommitDown(commits []*models.Commit, index int) error
- func (c *GitCommand) MovePatchIntoIndex(commits []*models.Commit, commitIdx int, p *patch.PatchManager, stash bool) error
- func (c *GitCommand) MovePatchToSelectedCommit(commits []*models.Commit, sourceCommitIdx int, destinationCommitIdx int, ...) error
- func (c *GitCommand) MoveTodoDown(index int) error
- func (c *GitCommand) NewBranch(name string, base string) error
- func (c *GitCommand) NewCmdObjFromStr(cmdStr string) oscommands.ICmdObj
- func (c *GitCommand) OpenMergeTool() error
- func (c *GitCommand) OpenMergeToolCmd() string
- func (c *GitCommand) PrepareInteractiveRebaseCommand(baseSha string, todo string, overrideEditor bool) (*exec.Cmd, error)
- func (c *GitCommand) Pull(opts PullOptions) error
- func (c *GitCommand) PullPatchIntoNewCommit(commits []*models.Commit, commitIdx int, p *patch.PatchManager) error
- func (c *GitCommand) Push(opts PushOpts) error
- func (c *GitCommand) PushTag(remoteName string, tagName string, promptUserForCredential func(string) string) error
- func (c *GitCommand) RebaseBranch(branchName string) error
- func (c *GitCommand) RebaseMode() (string, error)
- func (c *GitCommand) RemoveRemote(name string) error
- func (c *GitCommand) RemoveTrackedFiles(name string) error
- func (c *GitCommand) RemoveUntrackedDirFiles(node *filetree.FileNode) error
- func (c *GitCommand) RemoveUntrackedFiles() error
- func (c *GitCommand) RenameBranch(oldName string, newName string) error
- func (c *GitCommand) RenameCommit(name string) error
- func (c *GitCommand) RenameRemote(oldRemoteName string, newRemoteName string) error
- func (c *GitCommand) ResetAndClean() error
- func (c *GitCommand) ResetHard(ref string) error
- func (c *GitCommand) ResetMixed(ref string) error
- func (c *GitCommand) ResetSoft(ref string) error
- func (c *GitCommand) ResetSubmodules(submodules []*models.SubmoduleConfig) error
- func (c *GitCommand) ResetToCommit(sha string, strength string, options oscommands.RunCommandOptions) error
- func (c *GitCommand) Revert(sha string) error
- func (c *GitCommand) RevertMerge(sha string, parentNumber int) error
- func (c *GitCommand) RewordCommit(commits []*models.Commit, index int) (*exec.Cmd, error)
- func (c *GitCommand) RunCommand(formatString string, formatArgs ...interface{}) error
- func (c *GitCommand) RunCommandWithOutput(formatString string, formatArgs ...interface{}) (string, error)
- func (c *GitCommand) SetBranchUpstream(remoteName string, remoteBranchName string, branchName string) error
- func (c *GitCommand) SetUpstreamBranch(upstream string) error
- func (c *GitCommand) ShowCmdStr(sha string, filterPath string) string
- func (c *GitCommand) ShowFileDiff(from string, to string, reverse bool, fileName string, plain bool) (string, error)
- func (c *GitCommand) ShowFileDiffCmdStr(from string, to string, reverse bool, fileName string, plain bool) string
- func (c *GitCommand) ShowStashEntryCmdStr(index int) string
- func (c *GitCommand) SquashAllAboveFixupCommits(sha string) error
- func (c *GitCommand) StageAll() error
- func (c *GitCommand) StageFile(fileName string) error
- func (c *GitCommand) StashDo(index int, method string) error
- func (c *GitCommand) StashSave(message string) error
- func (c *GitCommand) StashSaveStagedChanges(message string) error
- func (c *GitCommand) SubmoduleAdd(name string, path string, url string) error
- func (c *GitCommand) SubmoduleBulkDeinitCmdStr() string
- func (c *GitCommand) SubmoduleBulkInitCmdStr() string
- func (c *GitCommand) SubmoduleBulkUpdateCmdStr() string
- func (c *GitCommand) SubmoduleDelete(submodule *models.SubmoduleConfig) error
- func (c *GitCommand) SubmoduleForceBulkUpdateCmdStr() string
- func (c *GitCommand) SubmoduleInit(path string) error
- func (c *GitCommand) SubmoduleReset(submodule *models.SubmoduleConfig) error
- func (c *GitCommand) SubmoduleStash(submodule *models.SubmoduleConfig) error
- func (c *GitCommand) SubmoduleUpdate(path string) error
- func (c *GitCommand) SubmoduleUpdateAll() error
- func (c *GitCommand) SubmoduleUpdateUrl(name string, path string, newUrl string) error
- func (c *GitCommand) UnStageFile(fileNames []string, reset bool) error
- func (c *GitCommand) UnstageAll() error
- func (c *GitCommand) UpdateRemoteUrl(remoteName string, updatedUrl string) error
- func (c *GitCommand) UsingGpg() bool
- func (c *GitCommand) WithSpan(span string) *GitCommand
- func (c *GitCommand) WorkingTreeState() string
- func (c *GitCommand) WorktreeFileDiff(file *models.File, plain bool, cached bool, ignoreWhitespace bool) string
- func (c *GitCommand) WorktreeFileDiffCmdStr(node models.IFile, plain bool, cached bool, ignoreWhitespace bool) string
- type GitStatusOptions
- type MergeOpts
- type PullOptions
- type PullRequest
- type PushOpts
- type RepoInformation
- type Service
Constants ¶
const ( REBASE_MODE_NORMAL = "normal" REBASE_MODE_INTERACTIVE = "interactive" REBASE_MODE_REBASING = "rebasing" REBASE_MODE_MERGING = "merging" )
const CurrentBranchNameRegex = `(?m)^\*.*?([^ ]*?)\)?$`
this takes something like:
- (HEAD detached at 264fc6f5) remotes
and returns '264fc6f5' as the second match
const SEPARATION_CHAR = "|"
Variables ¶
This section is empty.
Functions ¶
func VerifyInGitRepo ¶ added in v0.27.1
func VerifyInGitRepo(osCommand *oscommands.OSCommand) error
Types ¶
type BranchListBuilder ¶ added in v0.10.1
type BranchListBuilder struct { Log *logrus.Entry GitCommand *GitCommand ReflogCommits []*models.Commit }
BranchListBuilder returns a list of Branch objects for the current repo
func NewBranchListBuilder ¶ added in v0.10.1
func NewBranchListBuilder(log *logrus.Entry, gitCommand *GitCommand, reflogCommits []*models.Commit) (*BranchListBuilder, error)
NewBranchListBuilder builds a new branch list builder
func (*BranchListBuilder) Build ¶ added in v0.10.1
func (b *BranchListBuilder) Build() []*models.Branch
Build the list of branches for the current repo
type CheckoutOptions ¶ added in v0.20.1
Checkout checks out a branch (or commit), with --force if you set the force arg to true
type CommitListBuilder ¶ added in v0.10.1
type CommitListBuilder struct { Log *logrus.Entry GitCommand *GitCommand OSCommand *oscommands.OSCommand Tr *i18n.TranslationSet }
CommitListBuilder returns a list of Branch objects for the current repo
func NewCommitListBuilder ¶ added in v0.10.1
func NewCommitListBuilder( log *logrus.Entry, gitCommand *GitCommand, osCommand *oscommands.OSCommand, tr *i18n.TranslationSet, ) *CommitListBuilder
NewCommitListBuilder builds a new commit list builder
func (*CommitListBuilder) GetCommits ¶ added in v0.10.1
func (c *CommitListBuilder) GetCommits(opts GetCommitsOptions) ([]*models.Commit, error)
GetCommits obtains the commits of the current branch
func (*CommitListBuilder) MergeRebasingCommits ¶ added in v0.22.4
type FetchOptions ¶ added in v0.22.0
type FileStatus ¶ added in v0.30.1
type GetCommitsOptions ¶ added in v0.20.1
type GetStatusFileOptions ¶ added in v0.22.0
type GetStatusFileOptions struct {
NoRenames bool
}
GetStatusFiles git status files
type GitCommand ¶
type GitCommand struct { Log *logrus.Entry OSCommand *oscommands.OSCommand Repo *gogit.Repository Tr *i18n.TranslationSet Config config.AppConfigurer DotGitDir string PatchManager *patch.PatchManager GitConfig git_config.IGitConfig // Push to current determines whether the user has configured to push to the remote branch of the same name as the current or not PushToCurrent bool // this is just a view that we write to when running certain commands. // Coincidentally at the moment it's the same view that OnRunCommand logs to // but that need not always be the case. GetCmdWriter func() io.Writer // contains filtered or unexported fields }
GitCommand is our main git interface
func NewDummyGitCommand ¶ added in v0.7.1
func NewDummyGitCommand() *GitCommand
NewDummyGitCommand creates a new dummy GitCommand for testing
func NewDummyGitCommandWithOSCommand ¶ added in v0.7.1
func NewDummyGitCommandWithOSCommand(osCommand *oscommands.OSCommand) *GitCommand
NewDummyGitCommandWithOSCommand creates a new dummy GitCommand for testing
func NewGitCommand ¶
func NewGitCommand( log *logrus.Entry, osCommand *oscommands.OSCommand, tr *i18n.TranslationSet, config config.AppConfigurer, gitConfig git_config.IGitConfig, ) (*GitCommand, error)
NewGitCommand it runs git commands
func (*GitCommand) AddRemote ¶ added in v0.11.1
func (c *GitCommand) AddRemote(name string, url string) error
func (*GitCommand) AmendHead ¶ added in v0.7.1
func (c *GitCommand) AmendHead() error
AmendHead amends HEAD with whatever is staged in your working tree
func (*GitCommand) AmendHeadCmdStr ¶ added in v0.27.3
func (c *GitCommand) AmendHeadCmdStr() string
func (*GitCommand) AmendTo ¶ added in v0.7.1
func (c *GitCommand) AmendTo(sha string) error
AmendTo amends the given commit with whatever files are staged
func (*GitCommand) ApplyPatch ¶ added in v0.7.1
func (c *GitCommand) ApplyPatch(patch string, flags ...string) error
func (*GitCommand) BeforeAndAfterFileForRename ¶ added in v0.22.0
func (*GitCommand) BeginInteractiveRebaseForCommit ¶ added in v0.10.1
func (c *GitCommand) BeginInteractiveRebaseForCommit(commits []*models.Commit, commitIndex int) error
BeginInteractiveRebaseForCommit starts an interactive rebase to edit the current commit and pick all others. After this you'll want to call `c.GenericMergeOrRebaseAction("rebase", "continue")`
func (*GitCommand) CatFile ¶
func (c *GitCommand) CatFile(fileName string) (string, error)
CatFile obtains the content of a file
func (*GitCommand) CheckRemoteBranchExists ¶ added in v0.7.1
func (c *GitCommand) CheckRemoteBranchExists(branchName string) bool
CheckRemoteBranchExists Returns remote branch
func (*GitCommand) Checkout ¶
func (c *GitCommand) Checkout(branch string, options CheckoutOptions) error
func (*GitCommand) CheckoutFile ¶ added in v0.8.1
func (c *GitCommand) CheckoutFile(commitSha, fileName string) error
CheckoutFile checks out the file for the given commit
func (*GitCommand) CherryPickCommits ¶ added in v0.7.1
func (c *GitCommand) CherryPickCommits(commits []*models.Commit) error
CherryPickCommits begins an interactive rebase with the given shas being cherry picked onto HEAD
func (*GitCommand) CommitCmdStr ¶ added in v0.27.3
func (c *GitCommand) CommitCmdStr(message string, flags string) string
func (*GitCommand) ConfiguredPager ¶ added in v0.16.1
func (c *GitCommand) ConfiguredPager() string
func (*GitCommand) CreateFixupCommit ¶ added in v0.8.1
func (c *GitCommand) CreateFixupCommit(sha string) error
CreateFixupCommit creates a commit that fixes up a previous commit
func (*GitCommand) CreateLightweightTag ¶ added in v0.11.1
func (c *GitCommand) CreateLightweightTag(tagName string, commitSha string) error
func (*GitCommand) CurrentBranchName ¶ added in v0.7.1
func (c *GitCommand) CurrentBranchName() (string, string, error)
CurrentBranchName get the current branch name and displayname. the first returned string is the name and the second is the displayname e.g. name is 123asdf and displayname is '(HEAD detached at 123asdf)'
func (*GitCommand) DeleteBranch ¶
func (c *GitCommand) DeleteBranch(branch string, force bool) error
DeleteBranch delete branch
func (*GitCommand) DeletePatchesFromCommit ¶ added in v0.10.1
func (c *GitCommand) DeletePatchesFromCommit(commits []*models.Commit, commitIndex int, p *patch.PatchManager) error
DeletePatchesFromCommit applies a patch in reverse for a commit
func (*GitCommand) DeleteRemoteBranch ¶ added in v0.11.1
func (*GitCommand) DeleteTag ¶ added in v0.11.1
func (c *GitCommand) DeleteTag(tagName string) error
func (*GitCommand) DetectUnamePass ¶ added in v0.31.1
func (c *GitCommand) DetectUnamePass(cmdObj oscommands.ICmdObj, promptUserForCredential func(string) string) error
func (*GitCommand) DiscardAllDirChanges ¶ added in v0.27.1
func (c *GitCommand) DiscardAllDirChanges(node *filetree.FileNode) error
func (*GitCommand) DiscardAllFileChanges ¶ added in v0.8.1
func (c *GitCommand) DiscardAllFileChanges(file *models.File) error
DiscardAllFileChanges directly
func (*GitCommand) DiscardAnyUnstagedFileChanges ¶ added in v0.8.1
func (c *GitCommand) DiscardAnyUnstagedFileChanges() error
DiscardAnyUnstagedFileChanges discards any unstages file changes via `git checkout -- .`
func (*GitCommand) DiscardOldFileChanges ¶ added in v0.8.1
func (c *GitCommand) DiscardOldFileChanges(commits []*models.Commit, commitIndex int, fileName string) error
DiscardOldFileChanges discards changes to a file from an old commit
func (*GitCommand) DiscardUnstagedDirChanges ¶ added in v0.27.1
func (c *GitCommand) DiscardUnstagedDirChanges(node *filetree.FileNode) error
func (*GitCommand) DiscardUnstagedFileChanges ¶ added in v0.8.1
func (c *GitCommand) DiscardUnstagedFileChanges(file *models.File) error
DiscardUnstagedFileChanges directly
func (*GitCommand) EditFileCmdStr ¶ added in v0.27.3
func (c *GitCommand) EditFileCmdStr(filename string, lineNumber int) (string, error)
func (*GitCommand) EditRebaseTodo ¶ added in v0.7.1
func (c *GitCommand) EditRebaseTodo(index int, action string) error
EditRebaseTodo sets the action at a given index in the git-rebase-todo file
func (*GitCommand) FastForward ¶ added in v0.7.1
func (*GitCommand) FetchRemote ¶ added in v0.12.1
func (c *GitCommand) FetchRemote(remoteName string, promptUserForCredential func(string) string) error
func (*GitCommand) GenerateGenericRebaseTodo ¶ added in v0.7.1
func (*GitCommand) GenericMergeOrRebaseAction ¶ added in v0.23.1
func (c *GitCommand) GenericMergeOrRebaseAction(commandType string, command string) error
GenericMerge takes a commandType of "merge" or "rebase" and a command of "abort", "skip" or "continue" By default we skip the editor in the case where a commit will be made
func (*GitCommand) GetBranchGraph ¶
func (c *GitCommand) GetBranchGraph(branchName string) (string, error)
GetBranchGraph gets the color-formatted graph of the log for the given branch Currently it limits the result to 100 commits, but when we get async stuff working we can do lazy loading
func (*GitCommand) GetBranchGraphCmdStr ¶ added in v0.14.1
func (c *GitCommand) GetBranchGraphCmdStr(branchName string) string
func (*GitCommand) GetBranchUpstreamDifferenceCount ¶ added in v0.7.1
func (c *GitCommand) GetBranchUpstreamDifferenceCount(branchName string) (string, string)
func (*GitCommand) GetCommitDifferences ¶ added in v0.7.1
func (c *GitCommand) GetCommitDifferences(from, to string) (string, string)
GetCommitDifferences checks how many pushables/pullables there are for the current branch
func (*GitCommand) GetCommitMessage ¶ added in v0.22.0
func (c *GitCommand) GetCommitMessage(commitSha string) (string, error)
func (*GitCommand) GetCommitMessageFirstLine ¶ added in v0.30.1
func (c *GitCommand) GetCommitMessageFirstLine(sha string) (string, error)
func (*GitCommand) GetCurrentBranchUpstreamDifferenceCount ¶ added in v0.7.1
func (c *GitCommand) GetCurrentBranchUpstreamDifferenceCount() (string, string)
func (*GitCommand) GetFilesInDiff ¶ added in v0.22.0
func (c *GitCommand) GetFilesInDiff(from string, to string, reverse bool) ([]*models.CommitFile, error)
GetFilesInDiff get the specified commit files
func (*GitCommand) GetHeadCommitMessage ¶ added in v0.20.3
func (c *GitCommand) GetHeadCommitMessage() (string, error)
Get the subject of the HEAD commit
func (*GitCommand) GetPager ¶ added in v0.16.1
func (c *GitCommand) GetPager(width int) string
func (*GitCommand) GetReflogCommits ¶ added in v0.14.1
func (c *GitCommand) GetReflogCommits(lastReflogCommit *models.Commit, filterPath string) ([]*models.Commit, bool, error)
GetReflogCommits only returns the new reflog commits since the given lastReflogCommit if none is passed (i.e. it's value is nil) then we get all the reflog commits
func (*GitCommand) GetRemoteURL ¶ added in v0.7.1
func (c *GitCommand) GetRemoteURL() string
GetRemoteURL returns current repo remote url
func (*GitCommand) GetRemotes ¶ added in v0.11.1
func (c *GitCommand) GetRemotes() ([]*models.Remote, error)
func (*GitCommand) GetStashEntries ¶
func (c *GitCommand) GetStashEntries(filterPath string) []*models.StashEntry
GetStashEntries stash entries
func (*GitCommand) GetStatusFiles ¶
func (c *GitCommand) GetStatusFiles(opts GetStatusFileOptions) []*models.File
func (*GitCommand) GetSubmoduleConfigs ¶ added in v0.23.1
func (c *GitCommand) GetSubmoduleConfigs() ([]*models.SubmoduleConfig, error)
func (*GitCommand) GetUpstreamForBranch ¶ added in v0.10.6
func (c *GitCommand) GetUpstreamForBranch(branchName string) (string, error)
func (*GitCommand) GitStatus ¶
func (c *GitCommand) GitStatus(opts GitStatusOptions) ([]FileStatus, error)
func (*GitCommand) Ignore ¶
func (c *GitCommand) Ignore(filename string) error
Ignore adds a file to the gitignore for the repo
func (*GitCommand) InteractiveRebase ¶ added in v0.7.1
func (*GitCommand) IsBareRepo ¶ added in v0.23.1
func (c *GitCommand) IsBareRepo() bool
func (*GitCommand) IsHeadDetached ¶ added in v0.11.1
func (c *GitCommand) IsHeadDetached() bool
func (*GitCommand) IsInMergeState ¶
func (c *GitCommand) IsInMergeState() (bool, error)
IsInMergeState states whether we are still mid-merge
func (*GitCommand) Merge ¶
func (c *GitCommand) Merge(branchName string, opts MergeOpts) error
Merge merge
func (*GitCommand) MoveCommitDown ¶ added in v0.7.1
func (c *GitCommand) MoveCommitDown(commits []*models.Commit, index int) error
func (*GitCommand) MovePatchIntoIndex ¶ added in v0.28.1
func (c *GitCommand) MovePatchIntoIndex(commits []*models.Commit, commitIdx int, p *patch.PatchManager, stash bool) error
func (*GitCommand) MovePatchToSelectedCommit ¶ added in v0.10.1
func (c *GitCommand) MovePatchToSelectedCommit(commits []*models.Commit, sourceCommitIdx int, destinationCommitIdx int, p *patch.PatchManager) error
func (*GitCommand) MoveTodoDown ¶ added in v0.7.1
func (c *GitCommand) MoveTodoDown(index int) error
MoveTodoDown moves a rebase todo item down by one position
func (*GitCommand) NewBranch ¶
func (c *GitCommand) NewBranch(name string, base string) error
NewBranch create new branch
func (*GitCommand) NewCmdObjFromStr ¶ added in v0.30.1
func (c *GitCommand) NewCmdObjFromStr(cmdStr string) oscommands.ICmdObj
func (*GitCommand) OpenMergeTool ¶ added in v0.27.4
func (c *GitCommand) OpenMergeTool() error
func (*GitCommand) OpenMergeToolCmd ¶ added in v0.27.4
func (c *GitCommand) OpenMergeToolCmd() string
func (*GitCommand) PrepareInteractiveRebaseCommand ¶ added in v0.7.1
func (c *GitCommand) PrepareInteractiveRebaseCommand(baseSha string, todo string, overrideEditor bool) (*exec.Cmd, error)
PrepareInteractiveRebaseCommand returns the cmd for an interactive rebase we tell git to run lazygit to edit the todo list, and we pass the client lazygit a todo string to write to the todo file
func (*GitCommand) Pull ¶
func (c *GitCommand) Pull(opts PullOptions) error
func (*GitCommand) PullPatchIntoNewCommit ¶ added in v0.20.3
func (c *GitCommand) PullPatchIntoNewCommit(commits []*models.Commit, commitIdx int, p *patch.PatchManager) error
func (*GitCommand) Push ¶
func (c *GitCommand) Push(opts PushOpts) error
func (*GitCommand) RebaseBranch ¶ added in v0.7.1
func (c *GitCommand) RebaseBranch(branchName string) error
RebaseBranch interactive rebases onto a branch
func (*GitCommand) RebaseMode ¶ added in v0.7.1
func (c *GitCommand) RebaseMode() (string, error)
RebaseMode returns "" for non-rebase mode, "normal" for normal rebase and "interactive" for interactive rebase
func (*GitCommand) RemoveRemote ¶ added in v0.11.1
func (c *GitCommand) RemoveRemote(name string) error
func (*GitCommand) RemoveTrackedFiles ¶ added in v0.14.3
func (c *GitCommand) RemoveTrackedFiles(name string) error
RemoveTrackedFiles will delete the given file(s) even if they are currently tracked
func (*GitCommand) RemoveUntrackedDirFiles ¶ added in v0.27.1
func (c *GitCommand) RemoveUntrackedDirFiles(node *filetree.FileNode) error
func (*GitCommand) RemoveUntrackedFiles ¶ added in v0.8.1
func (c *GitCommand) RemoveUntrackedFiles() error
RemoveUntrackedFiles runs `git clean -fd`
func (*GitCommand) RenameBranch ¶ added in v0.17.0
func (c *GitCommand) RenameBranch(oldName string, newName string) error
func (*GitCommand) RenameCommit ¶
func (c *GitCommand) RenameCommit(name string) error
RenameCommit renames the topmost commit with the given name
func (*GitCommand) RenameRemote ¶ added in v0.11.1
func (c *GitCommand) RenameRemote(oldRemoteName string, newRemoteName string) error
func (*GitCommand) ResetAndClean ¶ added in v0.7.1
func (c *GitCommand) ResetAndClean() error
ResetAndClean removes all unstaged changes and removes all untracked files
func (*GitCommand) ResetHard ¶
func (c *GitCommand) ResetHard(ref string) error
ResetHardHead runs `git reset --hard`
func (*GitCommand) ResetMixed ¶ added in v0.28.1
func (c *GitCommand) ResetMixed(ref string) error
func (*GitCommand) ResetSoft ¶ added in v0.12.1
func (c *GitCommand) ResetSoft(ref string) error
ResetSoft runs `git reset --soft HEAD`
func (*GitCommand) ResetSubmodules ¶ added in v0.23.1
func (c *GitCommand) ResetSubmodules(submodules []*models.SubmoduleConfig) error
func (*GitCommand) ResetToCommit ¶
func (c *GitCommand) ResetToCommit(sha string, strength string, options oscommands.RunCommandOptions) error
ResetToCommit reset to commit
func (*GitCommand) Revert ¶ added in v0.7.1
func (c *GitCommand) Revert(sha string) error
Revert reverts the selected commit by sha
func (*GitCommand) RevertMerge ¶ added in v0.30.1
func (c *GitCommand) RevertMerge(sha string, parentNumber int) error
func (*GitCommand) RewordCommit ¶ added in v0.7.1
func (*GitCommand) RunCommand ¶ added in v0.27.1
func (c *GitCommand) RunCommand(formatString string, formatArgs ...interface{}) error
func (*GitCommand) RunCommandWithOutput ¶ added in v0.27.1
func (c *GitCommand) RunCommandWithOutput(formatString string, formatArgs ...interface{}) (string, error)
func (*GitCommand) SetBranchUpstream ¶ added in v0.11.1
func (c *GitCommand) SetBranchUpstream(remoteName string, remoteBranchName string, branchName string) error
func (*GitCommand) SetUpstreamBranch ¶ added in v0.10.6
func (c *GitCommand) SetUpstreamBranch(upstream string) error
func (*GitCommand) ShowCmdStr ¶ added in v0.14.1
func (c *GitCommand) ShowCmdStr(sha string, filterPath string) string
func (*GitCommand) ShowFileDiff ¶ added in v0.22.0
func (c *GitCommand) ShowFileDiff(from string, to string, reverse bool, fileName string, plain bool) (string, error)
ShowFileDiff get the diff of specified from and to. Typically this will be used for a single commit so it'll be 123abc^..123abc but when we're in diff mode it could be any 'from' to any 'to'. The reverse flag is also here thanks to diff mode.
func (*GitCommand) ShowFileDiffCmdStr ¶ added in v0.22.0
func (*GitCommand) ShowStashEntryCmdStr ¶ added in v0.14.1
func (c *GitCommand) ShowStashEntryCmdStr(index int) string
GetStashEntryDiff stash diff
func (*GitCommand) SquashAllAboveFixupCommits ¶ added in v0.8.1
func (c *GitCommand) SquashAllAboveFixupCommits(sha string) error
SquashAllAboveFixupCommits squashes all fixup! commits above the given one
func (*GitCommand) StageAll ¶ added in v0.2.0
func (c *GitCommand) StageAll() error
StageAll stages all files
func (*GitCommand) StageFile ¶
func (c *GitCommand) StageFile(fileName string) error
StageFile stages a file
func (*GitCommand) StashDo ¶
func (c *GitCommand) StashDo(index int, method string) error
StashDo modify stash
func (*GitCommand) StashSave ¶
func (c *GitCommand) StashSave(message string) error
StashSave save stash TODO: before calling this, check if there is anything to save
func (*GitCommand) StashSaveStagedChanges ¶ added in v0.8.1
func (c *GitCommand) StashSaveStagedChanges(message string) error
StashSaveStagedChanges stashes only the currently staged changes. This takes a few steps shoutouts to Joe on https://stackoverflow.com/questions/14759748/stashing-only-staged-changes-in-git-is-it-possible
func (*GitCommand) SubmoduleAdd ¶ added in v0.23.1
func (c *GitCommand) SubmoduleAdd(name string, path string, url string) error
func (*GitCommand) SubmoduleBulkDeinitCmdStr ¶ added in v0.23.1
func (c *GitCommand) SubmoduleBulkDeinitCmdStr() string
func (*GitCommand) SubmoduleBulkInitCmdStr ¶ added in v0.23.1
func (c *GitCommand) SubmoduleBulkInitCmdStr() string
func (*GitCommand) SubmoduleBulkUpdateCmdStr ¶ added in v0.23.1
func (c *GitCommand) SubmoduleBulkUpdateCmdStr() string
func (*GitCommand) SubmoduleDelete ¶ added in v0.23.1
func (c *GitCommand) SubmoduleDelete(submodule *models.SubmoduleConfig) error
func (*GitCommand) SubmoduleForceBulkUpdateCmdStr ¶ added in v0.23.1
func (c *GitCommand) SubmoduleForceBulkUpdateCmdStr() string
func (*GitCommand) SubmoduleInit ¶ added in v0.23.1
func (c *GitCommand) SubmoduleInit(path string) error
func (*GitCommand) SubmoduleReset ¶ added in v0.23.1
func (c *GitCommand) SubmoduleReset(submodule *models.SubmoduleConfig) error
func (*GitCommand) SubmoduleStash ¶ added in v0.23.1
func (c *GitCommand) SubmoduleStash(submodule *models.SubmoduleConfig) error
func (*GitCommand) SubmoduleUpdate ¶ added in v0.23.1
func (c *GitCommand) SubmoduleUpdate(path string) error
func (*GitCommand) SubmoduleUpdateAll ¶ added in v0.23.1
func (c *GitCommand) SubmoduleUpdateAll() error
func (*GitCommand) SubmoduleUpdateUrl ¶ added in v0.23.1
func (c *GitCommand) SubmoduleUpdateUrl(name string, path string, newUrl string) error
func (*GitCommand) UnStageFile ¶
func (c *GitCommand) UnStageFile(fileNames []string, reset bool) error
UnStageFile unstages a file we accept an array of filenames for the cases where a file has been renamed i.e. we accept the current name and the previous name
func (*GitCommand) UnstageAll ¶ added in v0.2.0
func (c *GitCommand) UnstageAll() error
UnstageAll unstages all files
func (*GitCommand) UpdateRemoteUrl ¶ added in v0.11.1
func (c *GitCommand) UpdateRemoteUrl(remoteName string, updatedUrl string) error
func (*GitCommand) UsingGpg ¶
func (c *GitCommand) UsingGpg() bool
UsingGpg tells us whether the user has gpg enabled so that we can know whether we need to run a subprocess to allow them to enter their password
func (*GitCommand) WithSpan ¶ added in v0.28.1
func (c *GitCommand) WithSpan(span string) *GitCommand
func (*GitCommand) WorkingTreeState ¶ added in v0.20.1
func (c *GitCommand) WorkingTreeState() string
func (*GitCommand) WorktreeFileDiff ¶ added in v0.22.0
func (c *GitCommand) WorktreeFileDiff(file *models.File, plain bool, cached bool, ignoreWhitespace bool) string
WorktreeFileDiff returns the diff of a file
func (*GitCommand) WorktreeFileDiffCmdStr ¶ added in v0.22.0
type GitStatusOptions ¶ added in v0.22.0
GitStatus returns the file status of the repo
type PullOptions ¶ added in v0.30.1
type PullRequest ¶ added in v0.7.1
type PullRequest struct { GitServices []*Service GitCommand *GitCommand }
PullRequest opens a link in browser to create new pull request with selected branch
func NewPullRequest ¶ added in v0.7.1
func NewPullRequest(gitCommand *GitCommand) *PullRequest
NewPullRequest creates new instance of PullRequest
type PushOpts ¶ added in v0.30.1
type PushOpts struct { Force bool UpstreamRemote string UpstreamBranch string SetUpstream bool PromptUserForCredential func(string) string }
Push pushes to a branch
type RepoInformation ¶ added in v0.7.1
RepoInformation holds some basic information about the repo
type Service ¶ added in v0.7.1
type Service struct { Name string // contains filtered or unexported fields }
Service is a service that repository is on (Github, Bitbucket, ...)
func NewService ¶ added in v0.16.1
NewService builds a Service based on the host type
Source Files ¶
- branches.go
- commits.go
- config.go
- dummies.go
- files.go
- git.go
- loading_branches.go
- loading_commit_files.go
- loading_commits.go
- loading_files.go
- loading_reflog_commits.go
- loading_remotes.go
- loading_stash.go
- loading_tags.go
- patch_rebases.go
- pull_request.go
- rebasing.go
- remotes.go
- stash_entries.go
- status.go
- submodules.go
- sync.go
- tags.go