From: Nicolas Pitre Date: Thu, 01 Feb 2007 21:59:46 GMT Subject: Re: [PATCH] git-checkout: disable guides how to switch branches with ui.guide Message-ID: In-Reply-To: <87ps8ta7fx.wl%cworth@cworth.org> On Thu, 1 Feb 2007, Carl Worth wrote: > I think the problem with this is that git tells the user so little > information, ("may lose your changes"). What changes? Is that dirty > state? Some commits? Hmm... have I committed anything? Why can't git > be sure about what this operation is going to do? > > I think a really useful message would be something like: > > You are not on any branch so switching to branch 'foo' > will cause the following commits to be lost: > > ba531642 A commit headline here... > b1189118 Another commit headline here... > > Refusing to checkout 'foo'. Please just display the last commit since this list could get long. > If there are no commits that would become dangling, then the checkout > should just proceed. As for the concern about losing a pointer to some > "valuable" state that will still technically be reachable, but might > be hard to get back, why not just print a message along the lines of: > > Leaving commit 7b1509f4 to checkout 'foo'. > > (or just depend on the HEAD reflog). It is not fully available yet. Nicolas