Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
19 changes: 19 additions & 0 deletions lib/git.zsh
Expand Up @@ -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
}