Subject: Re: pushing changes to a remote branch

From: Jan Hudec <[email-masked]>
Date: Sat, 14 Jul 2007 10:38:43 +0200

On Wed, Jul 11, 2007 at 14:26:14 -0700, Junio C Hamano wrote:
> Jan Hudec <[email-masked]> writes:
> 
> >>   $ git checkout origin/master
> >>   Note: moving to "origin/master" which isn't a local branch
> >>   If you want to create a new branch from this checkout, you may do so
> >>   (now or later) by using -b with the checkout command again. Example:
> >>     git checkout -b <new_branch_name>
> >>   HEAD is now at f4855d4... 1
> >
> > The problem of this warning is, that it does not actually say anything about
> > detached and that potential commit won't update the ref being checked out.
> 
> "Being detached" is a rather geekish synonym to "which isn't a
> local branch", isn't it?

In a sense, no, it is not. "Being detached" is a synonym of "HEAD is not
symbolic ref". The current warning does not really convey the information,
that the ref being checked out will not be updated. Maybe it could be
extended along the lines of following patch.

Hm, it will say the same when checking out with commit name, which does not
make sense much, though.

-->8--
Extend the detached head warning in checkout.

The warning when detaching head now explicitely states that ref being checked
out will not be updated.
---
 git-checkout.sh |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/git-checkout.sh b/git-checkout.sh
index 17f4392..502b2be 100755
--- a/git-checkout.sh
+++ b/git-checkout.sh
@@ -178,7 +178,8 @@ then
 	detached="$new"
 	if test -n "$oldbranch" && test -z "$quiet"
 	then
-		detach_warn="Note: moving to \"$new_name\" which isn't a local branch
+		detach_warn="Note: moving to \"$new_name\" which isn't a local branch, so it will
+_not_ be updated by local commits.
 If you want to create a new branch from this checkout, you may do so
 (now or later) by using -b with the checkout command again. Example:
   git checkout -b <new_branch_name>"

-- 
						 Jan 'Bulb' Hudec <[email-masked]>