Re: [PATCH/RFC] builtin-checkout: suggest creating local branch when appropriate to do so

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, 13 Oct 2009, Junio C Hamano wrote:

> Daniel Barkalow <barkalow@xxxxxxxxxxxx> writes:
> 
> > I suspect that a very common pattern for people who follow trees for 
> > testing and such or who only develop in topic branches is:
> > ...
> > << many issues with this kind of DWIM omitted >>
> > ...
> > On the second cycle, either git refuses or does something actively 
> > confusing to this user, and the user has to learn the difference between 
> > local branches and remote branches on the *second* cycle. IMHO, it's much 
> > better to make users learn things at the point when they don't think they 
> > know how to use the system, rather than when they think they understand it 
> > and are just trying to get things done.
> 
> Yeah, and I think J6t pointed out the same issue.
> 
> I think it tells us something, after some of "the most trusted Git
> contributors" thought "really long and hard, and making sure to take
> user-friendliness into account at least as much as simplicity of
> implementation", they are getting to the same conclusion that this
> particular DWIMery is a misguided attempt to be helpful without really
> helping but rather hurting the users.
> 
> I will stop trying to come up with a strawman for other people's itch that
> I do not agree to begin with, at least for now.  I will still look at
> concrete and workable proposals from other people, though.

I personally think that the real issue is that our "detached HEAD" message 
is still too scary, and what we really want is to issue the scary message 
when using "git commit" to move a detached HEAD from what was checked out 
to a new commit. So:

$ git checkout origin/next
(friendly message telling you you're browsing history)
$ git commit
(scary message telling you you're not on any branch)
$ git commit
(one line message like usual, except "detached HEAD" instead of branch 
name)

This still makes sure that you get the scary message before you could lose 
track of your work, but only gives it to you at the point where there's a 
commit that's in your HEAD and nowhere else.

The other thing that I think would be nice is:

$ git checkout origin/next
$ git fetch origin
$ git checkout !! (probably not a good syntax)

That is, expand "!!" to the string used to detach HEAD, and expand it 
again now. (Of course, something would have to be done if you did "git 
checkout HEAD^1" before, or "git checkout !!^1".) This is related in that 
I think the scary message should happen when "git commit" sees this stored 
string and clears it.

	-Daniel
*This .sig left intentionally blank*
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]