cola.gitcmds – Helper commands for git
Provides commands and queries for Git.
-
cola.gitcmds.abort_merge()
- Abort a merge by reading the tree at HEAD.
-
cola.gitcmds.all_files()
- Return the names of all files in the repository
-
cola.gitcmds.all_refs(split=False)
- 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)
-
cola.gitcmds.commit_diff(sha1)
-
cola.gitcmds.current_branch()
- Find the current branch.
-
cola.gitcmds.default_remote()
- Return the remote tracked by the current branch.
-
cola.gitcmds.diff_filenames(arg)
- 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)
- Invokes git diff on a filepath.
-
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)
- 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)
-
cola.gitcmds.log_helper(all=False, extra_args=None)
- Return parallel arrays containing the SHA-1s and summaries.
-
cola.gitcmds.merge_base_to(ref)
- Given ref, return $(git merge-base ref HEAD)..ref.
-
cola.gitcmds.merge_message()
- 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.renamed_files(start, end)
-
cola.gitcmds.rev_list_range(start, end)
- Return a (SHA-1, summary) pairs between start and end.
-
cola.gitcmds.tag_list()
- Return a list of tags.
-
cola.gitcmds.tracked_branch(branch=None)
- Return the remote branch associated with ‘branch’.
-
cola.gitcmds.unstage_paths(args)
Unstages paths from the staging area
This handles the git init case, which is why it’s not
just ‘git reset name’. For the git init case this falls
back to ‘git rm –cached’.
-
cola.gitcmds.untracked_files()
- 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.