From 2a46b984cd990f046bb5ff3039f8e92952fab968 Mon Sep 17 00:00:00 2001 From: Brian Gernhardt Date: Wed, 3 Jul 2013 00:50:37 -0400 Subject: 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" --- share/functions/__fish_git_prompt.fish | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) (limited to 'share/functions') 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 -- cgit v1.2.3