summaryrefslogtreecommitdiff
path: root/git-rebase.sh
diff options
context:
space:
mode:
authorBrian Gesiak <modocache@gmail.com>2014-04-16 17:31:48 +0900
committerJunio C Hamano <gitster@pobox.com>2014-04-16 14:02:11 -0700
commitf2d6e2b3239ee1c5ffb3cd25346719679a19ce6f (patch)
tree3dccc2af161004db6991b82a1b7efffa52e2c3b0 /git-rebase.sh
parent4f4074077fb0c3a2facc61b333337d024aeeebbf (diff)
downloadgit-bg/rebase-off-of-previous-branch.tar.gz
git-rebase: print name of rev when using shorthandbg/rebase-off-of-previous-branch
The output from a successful invocation of the shorthand command "git rebase -" is something like "Fast-forwarded HEAD to @{-1}", which includes a relative reference to a revision. Other commands that use the shorthand "-", such as "git checkout -", typically display the symbolic name of the revision. Change rebase to output the symbolic name of the revision when using the shorthand. For the example above, the new output is "Fast-forwarded HEAD to master", assuming "@{-1}" is a reference to "master". Requested-by: John Keeping <john@keeping.me.uk> Signed-off-by: Brian Gesiak <modocache@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'git-rebase.sh')
-rwxr-xr-xgit-rebase.sh8
1 files changed, 7 insertions, 1 deletions
diff --git a/git-rebase.sh b/git-rebase.sh
index 658c003c14..80f2630479 100755
--- a/git-rebase.sh
+++ b/git-rebase.sh
@@ -451,7 +451,13 @@ then
*) upstream_name="$1"
if test "$upstream_name" = "-"
then
- upstream_name="@{-1}"
+ upstream_name=`git rev-parse --symbolic-full-name @{-1}`
+ if test -n "$upstream_name"
+ then
+ upstream_name=${upstream_name#refs/heads/}
+ else
+ upstream_name="@{-1}"
+ fi
fi
shift
;;