From: Junio C Hamano Date: Fri, 26 Aug 2005 23:53:26 +0000 (-0700) Subject: Show the branch name more prominently in "git status". X-Git-Tag: v0.99.6~74 X-Git-Url: https://asedeno.scripts.mit.edu/gitweb/?a=commitdiff_plain;h=9804b7dc1974d59d4d37c37ba4624bb835456207;p=git.git 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 --- diff --git a/git-commit-script b/git-commit-script index e47a090c9..4987e3786 100755 --- a/git-commit-script +++ b/git-commit-script @@ -195,8 +195,8 @@ else fi if [ "$?" != "0" -a ! -f $GIT_DIR/MERGE_HEAD ] then - sed -ne '/^#/p' .editmsg - rm .editmsg + rm -f .editmsg + git-status-script exit 1 fi case "$no_edit" in diff --git a/git-status-script b/git-status-script index 947cc2197..1999a6697 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