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>
This commit is contained in:
parent
9a9cbb6e9f
commit
9804b7dc19
@ -195,8 +195,8 @@ else
|
|||||||
fi
|
fi
|
||||||
if [ "$?" != "0" -a ! -f $GIT_DIR/MERGE_HEAD ]
|
if [ "$?" != "0" -a ! -f $GIT_DIR/MERGE_HEAD ]
|
||||||
then
|
then
|
||||||
sed -ne '/^#/p' .editmsg
|
rm -f .editmsg
|
||||||
rm .editmsg
|
git-status-script
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
case "$no_edit" in
|
case "$no_edit" in
|
||||||
|
@ -28,6 +28,11 @@ report () {
|
|||||||
[ "$header" ]
|
[ "$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-update-cache --refresh >/dev/null 2>&1
|
||||||
git-diff-cache -M --cached HEAD | sed 's/^://' | report "Updated but not checked in" "will commit"
|
git-diff-cache -M --cached HEAD | sed 's/^://' | report "Updated but not checked in" "will commit"
|
||||||
committable="$?"
|
committable="$?"
|
||||||
@ -37,10 +42,4 @@ then
|
|||||||
echo "nothing to commit"
|
echo "nothing to commit"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
branch=`readlink "$GIT_DIR/HEAD"`
|
|
||||||
case "$branch" in
|
|
||||||
refs/heads/master) ;;
|
|
||||||
*) echo "#
|
|
||||||
# On branch $branch" ;;
|
|
||||||
esac
|
|
||||||
exit 0
|
exit 0
|
||||||
|
Loading…
Reference in New Issue
Block a user