summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHugues Hiegel <hugues@hiegel.fr>2008-10-17 14:46:15 +0200
committerHugues Hiegel <hugues@hiegel.fr>2008-10-17 14:46:15 +0200
commit4ebb0164d2e15645866de50b3b1f024729e37831 (patch)
treeef779da18ef64a783988d20c7048dfb69cf9694d
parente5ca0483a0fac0074cb8a5c2f3a9c8ec385ef457 (diff)
Adds a "Rebasing" info in git-rev.
-rw-r--r--01_Functions.zsh23
1 files changed, 11 insertions, 12 deletions
diff --git a/01_Functions.zsh b/01_Functions.zsh
index 75be2a3..b5b0fce 100644
--- a/01_Functions.zsh
+++ b/01_Functions.zsh
@@ -57,28 +57,27 @@ preprint()
get_git_branch ()
{
- local my_git_branch
+ local my_git_branch REBASE
[ "$( ( git-ls-tree HEAD . 2>&- ; git-ls-files . 2>&- ) | head -n 1)" == "" ] && return
+ # Rebase in progress ?
+ REBASE="";
+ [ -e $(git-rev-parse --git-dir)/../.dotest/rebasing ] && REBASE="rebase:"
+
# Get current working GIT branch
- my_git_branch="$(git-branch 2>&- | grep -E '^\* ' | cut -c3-)"
+ my_git_branch="$REBASE$(git-branch 2>&- | grep -E '^\* ' | cut -c3-)"
- if [ "$my_git_branch" != "" ]
+ if [ "$my_git_branch" != "$REBASE" ]
then
# If not on a working GIT branch, get the named current commit-ish inside parenthesis
- [ "$my_git_branch" == "(no branch)" ] &&\
- my_git_branch="($(git-name-rev HEAD 2>&- | awk '{ print $2 }' | sed 's,^tags/,,;s,^remotes/,,'))"
+ [ "$my_git_branch" == "$REBASE(no branch)" ] &&\
+ my_git_branch="($REBASE$(git-name-rev HEAD 2>&- | awk '{ print $2 }' | sed 's,^tags/,,;s,^remotes/,,'))"
# If neither on a named commit-ish, show commit-id
- if [ "$my_git_branch" == "(undefined)" ]
+ if [ "$my_git_branch" == "(${REBASE}undefined)" ]
then
- if [ -e $(git-rev-parse --git-dir)/.dotest-merge/git-rebase-todo ]
- then
- my_git_branch="(rebase: $(git-rev-parse HEAD 2>&-))"
- else
- my_git_branch="($(git-rev-parse HEAD 2>&-))"
- fi
+ my_git_branch="($REBASE$(git-rev-parse HEAD 2>&-))"
fi
fi