Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Add function to display if there is a rebase, merge or bisect going on on the prompt #844

Closed
wants to merge 1 commit into from

2 participants

@sirech

It is useful to create custom prompts

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Jan 17, 2012
  1. Add function to display if there is a rebase, merge or bisect going o…

    Mario Fernandez authored
    …n on the prompt
This page is out of date. Refresh to see the latest.
Showing with 19 additions and 0 deletions.
  1. +19 −0 lib/git.zsh
View
19 lib/git.zsh
@@ -62,3 +62,22 @@ git_prompt_status() {
fi
echo $STATUS
}
+
+# Checks if there is a bisect, merge or rebase currently going on
+git_prompt_rebase_state() {
+ STATUS=""
+
+ if [ -f ".git/BISECT_LOG" ] ; then
+ STATUS="$ZSH_THEME_GIT_PROMPT_STATE_BEFORE$ZSH_THEME_GIT_PROMPT_STATE_BISECT"
+ elif [ -f ".git/MERGE_HEAD" ] ; then
+ STATUS="$ZSH_THEME_GIT_PROMPT_STATE_BEFORE$ZSH_THEME_GIT_PROMPT_STATE_MERGE"
+ else
+ for dir in rebase rebase-apply rebase-merge ; do
+ if [ -d ".git/$dir" ] ; then
+ STATUS="$ZSH_THEME_GIT_PROMPT_STATE_BEFORE$ZSH_THEME_GIT_PROMPT_STATE_REBASE"
+ break
+ fi
+ done
+ fi
+ echo $STATUS
+}
Something went wrong with that request. Please try again.