cola.gitcmds – Helper commands for git

Provides commands and queries for Git.

exception cola.gitcmds.InvalidRepositoryError
cola.gitcmds.abort_merge()

Abort a merge by reading the tree at HEAD.

cola.gitcmds.all_files(git=<cola.git.GitCola object at 0xae3140c>)

Return the names of all files in the repository

cola.gitcmds.all_refs(split=False, git=<cola.git.GitCola object at 0xae3140c>)

Return a tuple of (local branches, remote branches, tags).

cola.gitcmds.branch_list(remote=False)

Return a list of local or remote branches

This explicitly removes HEAD from the list of remote branches.

cola.gitcmds.changed_files(start, end, git=<cola.git.GitCola object at 0xae3140c>)
cola.gitcmds.clear_cache()
cola.gitcmds.commit_diff(sha1, git=<cola.git.GitCola object at 0xae3140c>)
cola.gitcmds.current_branch(git=<cola.git.GitCola object at 0xae3140c>)

Return the current branch

cola.gitcmds.default_remote(config=None)

Return the remote tracked by the current branch.

cola.gitcmds.diff_filenames(arg, git=<cola.git.GitCola object at 0xae3140c>)

Return a list of filenames that have been modified

cola.gitcmds.diff_helper(commit=None, branch=None, ref=None, endref=None, filename=None, cached=True, with_diff_header=False, suppress_header=True, reverse=False, git=<cola.git.GitCola object at 0xae3140c>)

Invokes git diff on a filepath.

cola.gitcmds.diff_info(sha1, git=<cola.git.GitCola object at 0xae3140c>)
cola.gitcmds.eval_path(path)

handles quoted paths.

cola.gitcmds.export_patchset(start, end, output='patches', **kwargs)

Export patches from start^ to end.

cola.gitcmds.for_each_ref_basename(refs, git=<cola.git.GitCola object at 0xae3140c>)

Return refs starting with ‘refs’.

cola.gitcmds.format_patchsets(to_export, revs, output='patches')

Group contiguous revision selection into patchsets

Exists to handle multi-selection. Multiple disparate ranges in the revision selection are grouped into continuous lists.

cola.gitcmds.is_modified(name, git=<cola.git.GitCola object at 0xae3140c>)
cola.gitcmds.log_helper(all=False, extra_args=None)

Return parallel arrays containing the SHA-1s and summaries.

cola.gitcmds.merge_base_parent(branch)
cola.gitcmds.merge_base_to(ref)

Given ref, return $(git merge-base ref HEAD)..ref.

cola.gitcmds.merge_message(revision)

Return a merge message for FETCH_HEAD.

cola.gitcmds.merge_message_path()

Return the path to .git/MERGE_MSG or .git/SQUASH_MSG.

cola.gitcmds.parse_ls_tree(rev)

Return a list of(mode, type, sha1, path) tuples.

cola.gitcmds.parse_rev_list(raw_revs)

Parse git log –pretty=online output into (SHA-1, summary) pairs.

cola.gitcmds.partial_worktree_state_dict(files, head='HEAD')
cola.gitcmds.renamed_files(start, end, git=<cola.git.GitCola object at 0xae3140c>)
cola.gitcmds.rev_list_range(start, end)

Return a (SHA-1, summary) pairs between start and end.

cola.gitcmds.sha1_diff(sha1, git=<cola.git.GitCola object at 0xae3140c>)
cola.gitcmds.tag_list()

Return a list of tags.

cola.gitcmds.tracked_branch(branch=None, config=None)

Return the remote branch associated with ‘branch’.

cola.gitcmds.unstage_paths(args, head='HEAD')
cola.gitcmds.untracked_files(git=<cola.git.GitCola object at 0xae3140c>)

Returns a sorted list of untracked files.

cola.gitcmds.worktree_state(head='HEAD', staged_only=False)

Return a tuple of files in various states of being

Can be staged, unstaged, untracked, unmerged, or changed upstream.

cola.gitcmds.worktree_state_dict(head='HEAD', staged_only=False, update_index=False, git=<cola.git.GitCola object at 0xae3140c>)

Return a dict of files in various states of being

Return type:dict, keys are staged, unstaged, untracked, unmerged, changed_upstream, and submodule.

Previous topic

cola.git – Interface to the git command

Next topic

cola.guicmds – GUI Commands

This Page