cola.git – Interface to the git command

class cola.git.Git

The Git class manages communication with the Git binary

static execute(command, cwd=None, istream=None, with_exceptions=False, with_raw_output=False, with_status=False, with_stderr=False)

Execute a command and returns its output

command
The command argument list to execute
istream
Readable filehandle passed to subprocess.Popen.
cwd
The working directory when running commands. Default: os.getcwd()
with_status
Whether to return a (status, unicode(output)) tuple.
with_stderr
Whether to include stderr in the output stream
with_exceptions
Whether to raise an exception when git returns a non-zero status.
with_raw_output
Whether to avoid stripping off trailing whitespace.
Returns
unicode(stdout) # Default unicode(stdout+stderr) # with_stderr=True tuple(int(status), unicode(output)) # with_status=True
set_cwd(path)

Sets the current directory.

transform_kwargs(**kwargs)

Transforms Python style kwargs into git command line options.

class cola.git.GitCola

Subclass Git to provide search-for-git-dir

git_dir()
git_path(*paths)
is_valid()
load_worktree(path)
worktree()
cola.git.dashify(string)
cola.git.replace_carot(cmd_arg)

Guard against the windows command shell.

In the Windows shell, a carat character (^) may be used for line continuation. To guard against this, escape the carat by using two of them.

http://technet.microsoft.com/en-us/library/cc723564.aspx

Previous topic

cola.gitcfg – Interface to git config data

Next topic

cola.gitcmds – Helper commands for git

This Page