Version control branch info prompt formatter (xonsh.prompt.vc_branch)¶
Prompt formatter for simple version control branchs
-
xonsh.prompt.vc_branch.branch_bg_color()[source]¶ Return red if the current branch is dirty, yellow if the dirtiness can not be determined, and green if it clean. These are bacground colors.
-
xonsh.prompt.vc_branch.branch_color()[source]¶ Return red if the current branch is dirty, yellow if the dirtiness can not be determined, and green if it clean. These are bold, intense colors for the foreground.
-
xonsh.prompt.vc_branch.current_branch(pad=NotImplemented)[source]¶ Gets the branch for a current working directory. Returns an empty string if the cwd is not a repository. This currently only works for git and hg and should be extended in the future. If a timeout occurred, the string ‘<branch-timeout>’ is returned.
-
xonsh.prompt.vc_branch.dirty_working_directory(cwd=None)[source]¶ Returns a boolean as to whether there are uncommitted files in version control repository we are inside. If this cannot be determined, returns None. Currently supports git and hg.
-
xonsh.prompt.vc_branch.get_git_branch()[source]¶ Attempts to find the current git branch. If this could not be determined (timeout, not in a git repo, etc.) then this returns None.