C# Class GitCommands.GitCommandHelpers

Exibir arquivo Open project: gitextensions/gitextensions Class Usage Examples

Private Properties

Property Type Description
GetArgumentsRequiresSsh bool
GetBisectCommand string
GetCurrentSubmoduleChanges GitCommands.GitSubmoduleStatus
GetCurrentSubmoduleChanges GitCommands.GitSubmoduleStatus
GitItemStatusFromCopyRename GitCommands.GitItemStatus
GitItemStatusFromStatusCharacter GitCommands.GitItemStatus
IsCommitHash bool
IsDiffFile bool
StartProcess System.Diagnostics.Process
StartProcessAndReadAllBytes System.Diagnostics.Process
StartProcessAndReadAllText System.Diagnostics.Process
StartProcessAndReadLines IEnumerable

Public Methods

Method Description
AbortCmd ( ) : string
AbortRebaseCmd ( ) : string
AddSubmoduleCmd ( string remotePath, string localPath, string branch, bool force ) : string
BranchCmd ( string branchName, string revision, bool checkout ) : string
CheckoutCmd ( string branchOrRevisionName, LocalChangesAction changesAction ) : string
CherryPickCmd ( string cherry, bool commit, string arguments ) : string
CleanUpCmd ( bool dryrun, bool directories, bool nonignored, bool ignored, string paths = null ) : string
CloneCmd ( string fromPath, string toPath ) : string
CloneCmd ( string fromPath, string toPath, bool central, bool initSubmodules, [ branch, int depth, [ isSingleBranch ) : string

Git Clone.

ContinueBisectCmd ( GitBisectOption bisectOption ) : string
ContinueRebaseCmd ( ) : string
CreateOrphanCmd ( string newBranchName, string startPoint = null ) : string

Create a new orphan branch from startPoint and switch to it.

CreateProcessStartInfo ( string fileName, string arguments, string workingDirectory, Encoding outputEncoding ) : ProcessStartInfo
DeleteBranchCmd ( string branchName, bool force, bool remoteBranch ) : string
DeleteTagCmd ( string tagName ) : string
FindRenamesAndCopiesOpts ( ) : string
FindRenamesOpt ( ) : string
GetAllChangedFilesCmd ( bool excludeIgnoredFiles, UntrackedFilesMode untrackedFiles, IgnoreSubmodulesMode ignoreSubmodules ) : string
GetAllChangedFilesFromString ( GitModule module, string statusString, bool fromDiff = false ) : List
GetAssumeUnchangedFilesFromString ( GitModule module, string lsString ) : List
GetDefaultHomeDir ( ) : string
GetFileExtension ( string fileName ) : string
GetForcePushArgument ( ForcePushOptions force ) : string
GetFullBranchName ( string branch ) : string
GetHomeDir ( ) : string
GetPlinkCompatibleUrl ( string inputUrl ) : string

Transforms the given input Url to make it compatible with Plink, if necessary

GetRemoteName ( string completeName, IEnumerable remotes ) : string
GetSsh ( ) : string

Gets the git SSH command; or "" if the environment variable is NOT set.

GetSubmoduleStatus ( string text, GitModule module, string fileName ) : GitCommands.GitSubmoduleStatus
MergeBranchCmd ( string branch, bool allowFastForward, bool squash, bool noCommit, string strategy ) : string
MergedBranches ( ) : string
PatchCmd ( string patchFile ) : string
PatchCmdIgnoreWhitespace ( string patchFile ) : string
PatchDirCmd ( ) : string
PatchDirCmdIgnoreWhitespace ( ) : string
Plink ( ) : bool
PushMultipleCmd ( string remote, IEnumerable pushActions ) : string

Pushes multiple sets of local branches to remote branches.

PushTagCmd ( string path, string tag, bool all, ForcePushOptions force = ForcePushOptions.DoNotForce ) : string
ReadCmdOutputLines ( string cmd, string arguments, string workDir, string stdInput ) : IEnumerable

Run command, console window is hidden, wait for exit, redirect output

RebaseCmd ( string branch, bool interactive, bool preserveMerges, bool autosquash, bool autostash ) : string
RebaseRangeCmd ( string from, string branch, string onto, bool interactive, bool preserveMerges, bool autosquash, bool autostash ) : string
RemoveCmd ( bool force = true, bool isRecursive = true ) : string

Remove files from the working tree and from the index. git rm

ResetHardCmd ( string commit ) : string
ResetMixedCmd ( string commit ) : string
ResetSoftCmd ( string commit ) : string
ResolvedCmd ( ) : string
RevertCmd ( string commit, bool autoCommit, int parentIndex ) : string
RunCmd ( string cmd, string arguments ) : string

Run command, console window is hidden, wait for exit, redirect output

RunCmdByte ( string cmd, string arguments, string workingdir, byte stdInput, byte &output, byte &error ) : int

Run command, console window is hidden, wait for exit, redirect output

SetEnvironmentVariable ( bool reload = false ) : void
SetSsh ( string path ) : void

Sets the git SSH command path.

SkipCmd ( ) : string
SkipRebaseCmd ( ) : string
StartBisectCmd ( ) : string
StashSaveCmd ( bool untracked, bool keepIndex, string message ) : string
StopBisectCmd ( ) : string
SubmoduleSyncCmd ( string name ) : string
SubmoduleUpdateCmd ( string name ) : string
TerminateTree ( this process ) : void
UnsetSsh ( ) : void

Un-sets the git SSH command path.

UseSsh ( string arguments ) : bool

Private Methods

Method Description
GetArgumentsRequiresSsh ( string arguments ) : bool
GetBisectCommand ( GitBisectOption bisectOption ) : string
GetCurrentSubmoduleChanges ( GitModule module, string submodule ) : GitCommands.GitSubmoduleStatus
GetCurrentSubmoduleChanges ( GitModule module, string fileName, string oldFileName, bool staged ) : GitCommands.GitSubmoduleStatus
GitItemStatusFromCopyRename ( bool fromDiff, string nextfile, string fileName, char x, string status ) : GitCommands.GitItemStatus
GitItemStatusFromStatusCharacter ( string fileName, char x ) : GitCommands.GitItemStatus
IsCommitHash ( string value ) : bool

Check if a string represents a commit hash

IsDiffFile ( string path ) : bool
StartProcess ( string fileName, string arguments, string workingDirectory, Encoding outputEncoding ) : Process
StartProcessAndReadAllBytes ( string arguments, string cmd, string workDir, byte &stdOutput, byte &stdError, byte stdInput ) : Process
StartProcessAndReadAllText ( string arguments, string cmd, string workDir, string &stdOutput, string &stdError, string stdInput ) : Process
StartProcessAndReadLines ( string arguments, string cmd, string workDir, string stdInput ) : IEnumerable

Method Details

AbortCmd() public static method

public static AbortCmd ( ) : string
return string

AbortRebaseCmd() public static method

public static AbortRebaseCmd ( ) : string
return string

AddSubmoduleCmd() public static method

public static AddSubmoduleCmd ( string remotePath, string localPath, string branch, bool force ) : string
remotePath string
localPath string
branch string
force bool
return string

BranchCmd() public static method

public static BranchCmd ( string branchName, string revision, bool checkout ) : string
branchName string
revision string
checkout bool
return string

CheckoutCmd() public static method

public static CheckoutCmd ( string branchOrRevisionName, LocalChangesAction changesAction ) : string
branchOrRevisionName string
changesAction LocalChangesAction
return string

CherryPickCmd() public static method

public static CherryPickCmd ( string cherry, bool commit, string arguments ) : string
cherry string
commit bool
arguments string
return string

CleanUpCmd() public static method

public static CleanUpCmd ( bool dryrun, bool directories, bool nonignored, bool ignored, string paths = null ) : string
dryrun bool
directories bool
nonignored bool
ignored bool
paths string
return string

CloneCmd() public static method

public static CloneCmd ( string fromPath, string toPath ) : string
fromPath string
toPath string
return string

CloneCmd() public static method

Git Clone.
public static CloneCmd ( string fromPath, string toPath, bool central, bool initSubmodules, [ branch, int depth, [ isSingleBranch ) : string
fromPath string
toPath string
central bool Makes a bare repo.
initSubmodules bool
branch [ /// NULL: do not checkout working copy (--no-checkout). /// "" (empty string): checkout remote HEAD (branch param omitted, default behavior for clone). /// (a non-empty string): checkout the given branch (--branch smth). ///
depth int An int value for --depth param, or NULL to omit the param.
isSingleBranch [ /// True: --single-branch. /// False: --no-single-branch. /// NULL: don't pass any such param to git. ///
return string

ContinueBisectCmd() public static method

public static ContinueBisectCmd ( GitBisectOption bisectOption ) : string
bisectOption GitBisectOption
return string

ContinueRebaseCmd() public static method

public static ContinueRebaseCmd ( ) : string
return string

CreateOrphanCmd() public static method

Create a new orphan branch from startPoint and switch to it.
public static CreateOrphanCmd ( string newBranchName, string startPoint = null ) : string
newBranchName string
startPoint string
return string

CreateProcessStartInfo() public static method

public static CreateProcessStartInfo ( string fileName, string arguments, string workingDirectory, Encoding outputEncoding ) : ProcessStartInfo
fileName string
arguments string
workingDirectory string
outputEncoding System.Text.Encoding
return System.Diagnostics.ProcessStartInfo

DeleteBranchCmd() public static method

public static DeleteBranchCmd ( string branchName, bool force, bool remoteBranch ) : string
branchName string
force bool
remoteBranch bool
return string

DeleteTagCmd() public static method

public static DeleteTagCmd ( string tagName ) : string
tagName string
return string

FindRenamesAndCopiesOpts() public static method

public static FindRenamesAndCopiesOpts ( ) : string
return string

FindRenamesOpt() public static method

public static FindRenamesOpt ( ) : string
return string

GetAllChangedFilesCmd() public static method

public static GetAllChangedFilesCmd ( bool excludeIgnoredFiles, UntrackedFilesMode untrackedFiles, IgnoreSubmodulesMode ignoreSubmodules ) : string
excludeIgnoredFiles bool
untrackedFiles UntrackedFilesMode
ignoreSubmodules IgnoreSubmodulesMode
return string

GetAllChangedFilesFromString() public static method

public static GetAllChangedFilesFromString ( GitModule module, string statusString, bool fromDiff = false ) : List
module GitModule
statusString string
fromDiff bool
return List

GetAssumeUnchangedFilesFromString() public static method

public static GetAssumeUnchangedFilesFromString ( GitModule module, string lsString ) : List
module GitModule
lsString string
return List

GetDefaultHomeDir() public static method

public static GetDefaultHomeDir ( ) : string
return string

GetFileExtension() public static method

public static GetFileExtension ( string fileName ) : string
fileName string
return string

GetForcePushArgument() public static method

public static GetForcePushArgument ( ForcePushOptions force ) : string
force ForcePushOptions
return string

GetFullBranchName() public static method

public static GetFullBranchName ( string branch ) : string
branch string
return string

GetHomeDir() public static method

public static GetHomeDir ( ) : string
return string

GetPlinkCompatibleUrl() public static method

Transforms the given input Url to make it compatible with Plink, if necessary
public static GetPlinkCompatibleUrl ( string inputUrl ) : string
inputUrl string
return string

GetRemoteName() public static method

public static GetRemoteName ( string completeName, IEnumerable remotes ) : string
completeName string
remotes IEnumerable
return string

GetSsh() public static method

Gets the git SSH command; or "" if the environment variable is NOT set.
public static GetSsh ( ) : string
return string

GetSubmoduleStatus() public static method

public static GetSubmoduleStatus ( string text, GitModule module, string fileName ) : GitCommands.GitSubmoduleStatus
text string
module GitModule
fileName string
return GitCommands.GitSubmoduleStatus

MergeBranchCmd() public static method

public static MergeBranchCmd ( string branch, bool allowFastForward, bool squash, bool noCommit, string strategy ) : string
branch string
allowFastForward bool
squash bool
noCommit bool
strategy string
return string

MergedBranches() public static method

public static MergedBranches ( ) : string
return string

PatchCmd() public static method

public static PatchCmd ( string patchFile ) : string
patchFile string
return string

PatchCmdIgnoreWhitespace() public static method

public static PatchCmdIgnoreWhitespace ( string patchFile ) : string
patchFile string
return string

PatchDirCmd() public static method

public static PatchDirCmd ( ) : string
return string

PatchDirCmdIgnoreWhitespace() public static method

public static PatchDirCmdIgnoreWhitespace ( ) : string
return string

Plink() public static method

public static Plink ( ) : bool
return bool

PushMultipleCmd() public static method

Pushes multiple sets of local branches to remote branches.
public static PushMultipleCmd ( string remote, IEnumerable pushActions ) : string
remote string
pushActions IEnumerable
return string

PushTagCmd() public static method

public static PushTagCmd ( string path, string tag, bool all, ForcePushOptions force = ForcePushOptions.DoNotForce ) : string
path string
tag string
all bool
force ForcePushOptions
return string

ReadCmdOutputLines() public static method

Run command, console window is hidden, wait for exit, redirect output
public static ReadCmdOutputLines ( string cmd, string arguments, string workDir, string stdInput ) : IEnumerable
cmd string
arguments string
workDir string
stdInput string
return IEnumerable

RebaseCmd() public static method

public static RebaseCmd ( string branch, bool interactive, bool preserveMerges, bool autosquash, bool autostash ) : string
branch string
interactive bool
preserveMerges bool
autosquash bool
autostash bool
return string

RebaseRangeCmd() public static method

public static RebaseRangeCmd ( string from, string branch, string onto, bool interactive, bool preserveMerges, bool autosquash, bool autostash ) : string
from string
branch string
onto string
interactive bool
preserveMerges bool
autosquash bool
autostash bool
return string

RemoveCmd() public static method

Remove files from the working tree and from the index. git rm
public static RemoveCmd ( bool force = true, bool isRecursive = true ) : string
force bool Override the up-to-date check.
isRecursive bool Allow recursive removal when a leading directory name is given.
return string

ResetHardCmd() public static method

public static ResetHardCmd ( string commit ) : string
commit string
return string

ResetMixedCmd() public static method

public static ResetMixedCmd ( string commit ) : string
commit string
return string

ResetSoftCmd() public static method

public static ResetSoftCmd ( string commit ) : string
commit string
return string

ResolvedCmd() public static method

public static ResolvedCmd ( ) : string
return string

RevertCmd() public static method

public static RevertCmd ( string commit, bool autoCommit, int parentIndex ) : string
commit string
autoCommit bool
parentIndex int
return string

RunCmd() public static method

Run command, console window is hidden, wait for exit, redirect output
public static RunCmd ( string cmd, string arguments ) : string
cmd string
arguments string
return string

RunCmdByte() public static method

Run command, console window is hidden, wait for exit, redirect output
public static RunCmdByte ( string cmd, string arguments, string workingdir, byte stdInput, byte &output, byte &error ) : int
cmd string
arguments string
workingdir string
stdInput byte
output byte
error byte
return int

SetEnvironmentVariable() public static method

public static SetEnvironmentVariable ( bool reload = false ) : void
reload bool
return void

SetSsh() public static method

Sets the git SSH command path.
public static SetSsh ( string path ) : void
path string
return void

SkipCmd() public static method

public static SkipCmd ( ) : string
return string

SkipRebaseCmd() public static method

public static SkipRebaseCmd ( ) : string
return string

StartBisectCmd() public static method

public static StartBisectCmd ( ) : string
return string

StashSaveCmd() public static method

public static StashSaveCmd ( bool untracked, bool keepIndex, string message ) : string
untracked bool
keepIndex bool
message string
return string

StopBisectCmd() public static method

public static StopBisectCmd ( ) : string
return string

SubmoduleSyncCmd() public static method

public static SubmoduleSyncCmd ( string name ) : string
name string
return string

SubmoduleUpdateCmd() public static method

public static SubmoduleUpdateCmd ( string name ) : string
name string
return string

TerminateTree() public static method

public static TerminateTree ( this process ) : void
process this
return void

UnsetSsh() public static method

Un-sets the git SSH command path.
public static UnsetSsh ( ) : void
return void

UseSsh() public static method

public static UseSsh ( string arguments ) : bool
arguments string
return bool