summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJosef Weidendorfer <Josef.Weidendorfer@gmx.de>2006-02-15 19:22:11 (GMT)
committerJunio C Hamano <junkio@cox.net>2006-02-16 03:14:04 (GMT)
commitbabfaf8dee0baa09c56d1a2ec5623b60d900518b (patch)
tree7cbd3994c0a3c9096905ac728c597fff1875887d
parent6c5c62f3401dc8f4b567af46582c112f6a859b5e (diff)
downloadgit-1.2.1.zip
git-1.2.1.tar.gz
git-1.2.1.tar.bz2
More useful/hinting error messages in git-checkoutv1.2.1
Signed-off-by: Josef Weidendorfer <Josef.Weidendorfer@gmx.de> Signed-off-by: Junio C Hamano <junkio@cox.net>
-rwxr-xr-xgit-checkout.sh13
1 files changed, 10 insertions, 3 deletions
diff --git a/git-checkout.sh b/git-checkout.sh
index 76e7f55..463ed2e 100755
--- a/git-checkout.sh
+++ b/git-checkout.sh
@@ -22,7 +22,7 @@ while [ "$#" != "0" ]; do
[ -e "$GIT_DIR/refs/heads/$newbranch" ] &&
die "git checkout: branch $newbranch already exists"
git-check-ref-format "heads/$newbranch" ||
- die "we do not like '$newbranch' as a branch name."
+ die "git checkout: we do not like '$newbranch' as a branch name."
;;
"-f")
force=1
@@ -75,9 +75,15 @@ done
if test "$#" -ge 1
then
+ hint=
+ if test "$#" -eq 1
+ then
+ hint="
+Did you intend to checkout '$@' which can not be resolved as commit?"
+ fi
if test '' != "$newbranch$force$merge"
then
- die "updating paths and switching branches or forcing are incompatible."
+ die "git checkout: updating paths is incompatible with switching branches/forcing$hint"
fi
if test '' != "$new"
then
@@ -117,7 +123,8 @@ fi
[ -z "$branch$newbranch" ] &&
[ "$new" != "$old" ] &&
- die "git checkout: you need to specify a new branch name"
+ die "git checkout: to checkout the requested commit you need to specify
+ a name for a new branch which is created and switched to"
if [ "$force" ]
then