summaryrefslogtreecommitdiff
path: root/git-status-script
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <junkio@cox.net>2005-08-26 16:53:26 -0700
committerLibravatar Junio C Hamano <junkio@cox.net>2005-08-28 12:15:09 -0700
commit9804b7dc1974d59d4d37c37ba4624bb835456207 (patch)
tree00ea6ac52cf531e1c226c7280e412e4c1bb010d0 /git-status-script
parentBarf nicely when "git push" is run without parameter. (diff)
downloadtgif-9804b7dc1974d59d4d37c37ba4624bb835456207.tar.xz
Show the branch name more prominently in "git status".
When not working on "master" branch, remind the user at the beginning of the status message, not at the end. Signed-off-by: Junio C Hamano <junkio@cox.net>
Diffstat (limited to 'git-status-script')
-rwxr-xr-xgit-status-script11
1 files changed, 5 insertions, 6 deletions
diff --git a/git-status-script b/git-status-script
index 947cc21975..1999a66979 100755
--- a/git-status-script
+++ b/git-status-script
@@ -28,6 +28,11 @@ report () {
[ "$header" ]
}
+branch=`readlink "$GIT_DIR/HEAD"`
+case "$branch" in
+refs/heads/master) ;;
+*) echo "# On branch $branch" ;;
+esac
git-update-cache --refresh >/dev/null 2>&1
git-diff-cache -M --cached HEAD | sed 's/^://' | report "Updated but not checked in" "will commit"
committable="$?"
@@ -37,10 +42,4 @@ then
echo "nothing to commit"
exit 1
fi
-branch=`readlink "$GIT_DIR/HEAD"`
-case "$branch" in
-refs/heads/master) ;;
-*) echo "#
-# On branch $branch" ;;
-esac
exit 0