aboutsummaryrefslogtreecommitdiffhomepage
path: root/share/functions/__fish_git_prompt.fish
diff options
context:
space:
mode:
authorGravatar Brian Gernhardt <brian@gernhardtsoftware.com>2013-07-03 00:50:37 -0400
committerGravatar Brian Gernhardt <brian@gernhardtsoftware.com>2013-07-26 22:05:06 -0400
commit2a46b984cd990f046bb5ff3039f8e92952fab968 (patch)
treed04215378ee905b760f4b862f4bfeaa417ebe43b /share/functions/__fish_git_prompt.fish
parent5a7b85adc71502a22003a9d9dc754464425226dc (diff)
git_prompt: show where rebase is at when stopped
Adds a progress indicator to the rebase messages. (e.g. |REBASE 2/5) based on the git-prompt portion of git.git b71dc3e: "bash-prompt.sh: show where rebase is at when stopped"
Diffstat (limited to 'share/functions/__fish_git_prompt.fish')
-rw-r--r--share/functions/__fish_git_prompt.fish21
1 files changed, 16 insertions, 5 deletions
diff --git a/share/functions/__fish_git_prompt.fish b/share/functions/__fish_git_prompt.fish
index 333267a3..c58ed37a 100644
--- a/share/functions/__fish_git_prompt.fish
+++ b/share/functions/__fish_git_prompt.fish
@@ -447,16 +447,23 @@ function __fish_git_prompt_operation_branch_bare --description "__fish_git_promp
set -l operation
set -l detached no
set -l bare
+ set -l step
+ set -l total
set -l os
- if test -f $git_dir/rebase-merge/interactive
- set operation "|REBASE-i"
- set branch (cat $git_dir/rebase-merge/head-name ^/dev/null)
- else if test -d $git_dir/rebase-merge
- set operation "|REBASE-m"
+ if test -d $git_dir/rebase-merge
set branch (cat $git_dir/rebase-merge/head-name ^/dev/null)
+ set step (cat $git_dir/rebase-merge/msgnum ^/dev/null)
+ set total (cat $git_dir/rebase-merge/end ^/dev/null)
+ if test -f $git_dir/rebase-merge/interactive
+ set operation "|REBASE-i"
+ else
+ set operation "|REBASE-m"
+ end
else
if test -d $git_dir/rebase-apply
+ set step (cat $git_dir/rebase-apply/next ^/dev/null)
+ set total (cat $git_dir/rebase-apply/last ^/dev/null)
if test -f $git_dir/rebase-apply/rebasing
set operation "|REBASE"
else if test -f $git_dir/rebase-apply/applying
@@ -475,6 +482,10 @@ function __fish_git_prompt_operation_branch_bare --description "__fish_git_promp
end
end
+ if test -n "$step" -a -n "$total"
+ set operation "$operation $step/$total"
+ end
+
if test -z "$branch"
set branch (git symbolic-ref HEAD ^/dev/null; set os $status)
if test $os -ne 0