Comments and changes to this ticket
-

Pieter de Bie January 25th, 2009 @ 04:41 PM
I understand that you want to do that.
However, I also think this can be very confusing for beginning users, as they might not understand the concept of a detached HEAD yet.
That's why I'm reluctant to add this. If I do add it, it should probably contain some kind of warning message before continuing.
This won't find its way into 0.6, but maybe 0.7
-

Pieter de Bie January 25th, 2009 @ 04:41 PM
- Milestone set to 0.7
- State changed from new to open
-

Dave Grijalva January 26th, 2009 @ 09:44 PM
I realize the opportunity for confusion here, but I think this is an important feature. If a warning message must be used, please make sure it's only displayed once or can be disabled from with in the message. Better yet, create a tag for the history view (like the boxed branch/tag) names for HEAD when the user is not on a branch. Make it red or otherwise distinct.
-

Pieter de Bie March 24th, 2009 @ 01:05 AM
- State changed from open to resolved
I've thought about this for a bit and I think the easiest way for you to do this is to just create a temporary branch and then check that out. That should be enough for everyone, and you can just delete the branch afterwards.
-

Antony Stubbs March 31st, 2009 @ 03:07 AM
What's the confusion? Git supports this pretty majorly - I'm using it right now to try and track down a bug, by checking out commits backwards step by step via git checkout [hash] - it would be so much nicer to just right click - checkout. creating temp branches for this is overkill as each checkout doesn't last long, until you find the checkout that broke something.
-

Pieter de Bie March 31st, 2009 @ 04:45 PM
sounds like what you really want is 'git bisect', your example doesn't convince me of a valid use case.
-

Johannes Gilger March 31st, 2009 @ 07:17 PM
We could simply disable the commit-view when on a detached HEAD, to make people aware that this is not really meant to be worked on (and then provide a super-hidden option to be able to commit anyway) ;)
-

Pieter de Bie March 31st, 2009 @ 07:25 PM
That'd still allow people to commit on the command line.
I think it'll still cause confusion, even with a warning, because people won't see the difference between right-clicking on a label and selecting 'checkout' and right-clicking on a revision and selecting 'checkout'. If they then commit and checkout another branch, it's a very tedious process to get everything back.
-

kwerle March 31st, 2009 @ 07:30 PM
So I'm a beginning user. I want this feature so that I can run code as of a certain tag. I do not understand the danger, or perhaps it's just too obvious for me to perceive it as a danger.
We all know it's easy for git to check something out as of a certain tag.
So what, exactly, is the danger? What is the downside?
-

Johannes Gilger March 31st, 2009 @ 08:52 PM
The danger is that when you commit on a detached head you have no easy/direct way of going back to that commit once you switch to another branch at some point. The branches are just pointers to commits, without them the whole git repository would be only big storage for commits (objects in general).
And you made Pieters point just valid.
-

kwerle March 31st, 2009 @ 10:03 PM
And you made Pieters point just valid.
I think I quite understand what I'm doing.
The danger is that when you commit on a detached head you have no easy/direct way of going back to that commit once you switch to another branch at some point.
How so? Won't it be listed in the tree?
-

Johannes Gilger March 31st, 2009 @ 10:22 PM
In which tree? You only have a list of commits if you have one commit to start with, and those commits to start with (called "heads") are the commits that the branches point to. Sure, all the commit-objects are in your store, and if you know your way around reflog you can recover it in about 30 days, after that they might get cleaned by git gc and are irrevokably gone.
-

kwerle March 31st, 2009 @ 10:54 PM
So it seems like the safest thing to do, if you wanted to commit from a detached head is to branch right there. It sounds like this is what Johannes was getting at when he suggested disabling the commit-view when looking at a detached head.
My need is quite simple: I just want to check it out and take it for a spin. I'd be happy if the commit-view was disabled. I'd be slightly less happy if it insisted I branch it on the spot - but I"d cope; you can delete it.
I would be happiest if it just behaved as usual until I tried to commit, and then suggested that I branch and then commit to the branch.
Please Sign in or create a free account to add a new ticket.
With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile »
GitX is the nice-looking gitk clone for OS X
People watching this ticket
Referenced by
-
#125 right click on revision in history view - checkout
You can already checkout branches through the context men...
-
#125 right click on revision in history view - checkout
Commented and watching ticket #61.