Re: [PATCH] Detached HEAD (experimental)

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Daniel Barkalow
Date: Wednesday, January 10, 2007 - 9:30 am

On Wed, 10 Jan 2007, Junio C Hamano wrote:


I don't think this would actually work. If you commit your build fix, and 
then mark the result as bad, won't bisect skew its choices due to 
suspecting that your build fix is the real bug?

I'd think that, if you make changes while bisecting, you probably want to 
leave those changes uncommitted, and merge or discard them when testing 
other commits.

If anything, I'd think you'd want a rather different sort of commit 
mechanism than the usual commit, which says, "whenever you consider commit 
{sha1-from-real-history}, use {tree-with-local-changes} instead of 
{tree-in-real-commit}." Or, more generally, "in order to get the trees 
I want to actually use, this patch (git diff HEAD) needs to be applied to 
every commit in some portion of the history including, at least, 
get_sha1(HEAD)".

I'm not seeing any actual benefit to causing the history to contain a 
dead-end fork off of an antique commit, and then throwing this away. And 
committing your change so that it won't get lost, with the intention of 
losing it in a little while, doesn't seem to make any sense, either.

(Of course, it also makes sense to do merges, but again, you probably want 
to create and temporarily use the working tree resulting from the merge, 
not create the commit.)

I think that the workflow that uses regular commits with a detached HEAD 
is this: do a series of commits representing real work on top of a remote 
branch or a tag, and decide later (once you've tested the results for 
worthiness) whether to turn this into a topic branch or throw it away.

But I don't think this is a good match for detached HEAD, because you may 
want to do exactly the same thing, but start with a regular local head. I 
think the right thing to do is something like "git checkout --anon", which 
puts you on a new branch with no name, which will evaporate if you leave 
it (as per "git branch -d"; you need to force it if it isn't fully 
merged).

So I think the feature which lets you make commits without being on a 
branch from refs/heads is actually a different feature from "detached 
HEAD", which only shares the aspect that "git branch" has no line with a 
"*", because there is no name for what HEAD points to.

(I'd implement "anonymous branch" by putting you on refs/heads/.anon, and 
adding rules for this situation to for_each_ref and update_ref; but that's 
an implementation detail, and shouldn't affect the intended semantics of 
the feature.)

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

Messages in current thread:
[PATCH] Detached HEAD (experimental), Junio C Hamano, (Tue Jan 2, 12:45 am)
Re: [PATCH] Detached HEAD (experimental), Edgar Toernig, (Tue Jan 2, 12:59 pm)
Re: [PATCH] Detached HEAD (experimental), Carl Worth, (Tue Jan 2, 2:56 pm)
Re: [PATCH] Detached HEAD (experimental), Junio C Hamano, (Tue Jan 2, 3:44 pm)
[PATCH] git-branch: show detached HEAD, Lars Hjemli, (Tue Jan 2, 4:22 pm)
Re: [PATCH] Detached HEAD (experimental), Carl Worth, (Tue Jan 2, 4:34 pm)
Re: [PATCH] Detached HEAD (experimental), Junio C Hamano, (Tue Jan 2, 7:45 pm)
Re: [PATCH] git-branch: show detached HEAD, Shawn O. Pearce, (Tue Jan 2, 10:18 pm)
Re: [PATCH] git-branch: show detached HEAD, Junio C Hamano, (Wed Jan 3, 12:05 am)
Re: [PATCH] git-branch: show detached HEAD, Lars Hjemli, (Wed Jan 3, 12:37 am)
Re: [PATCH] Detached HEAD (experimental), Jeff King, (Wed Jan 3, 3:46 am)
Re: [PATCH] Detached HEAD (experimental), Jeff King, (Wed Jan 3, 4:59 am)
Re: [PATCH] Detached HEAD (experimental), Junio C Hamano, (Mon Jan 8, 4:19 am)
Re: [PATCH] Detached HEAD (experimental), Jeff King, (Mon Jan 8, 6:17 am)
Re: [PATCH] Detached HEAD (experimental), Junio C Hamano, (Mon Jan 8, 5:19 pm)
Re: [PATCH] Detached HEAD (experimental), Carl Worth, (Mon Jan 8, 5:43 pm)
Re: [PATCH] Detached HEAD (experimental), Junio C Hamano, (Mon Jan 8, 6:05 pm)
Re: [PATCH] Detached HEAD (experimental), Carl Worth, (Mon Jan 8, 6:15 pm)
Re: [PATCH] Detached HEAD (experimental), Shawn O. Pearce, (Mon Jan 8, 8:26 pm)
Re: [PATCH] Detached HEAD (experimental), Junio C Hamano, (Tue Jan 9, 12:07 am)
Re: [PATCH] Detached HEAD (experimental), Luben Tuikov, (Tue Jan 9, 1:12 am)
Re: [PATCH] Detached HEAD (experimental), Jeff King, (Tue Jan 9, 7:21 am)
Re: [PATCH] Detached HEAD (experimental), Junio C Hamano, (Tue Jan 9, 2:20 pm)
Re: [PATCH] Detached HEAD (experimental), J. Bruce Fields, (Tue Jan 9, 2:31 pm)
Re: [PATCH] Detached HEAD (experimental), Carl Worth, (Tue Jan 9, 2:43 pm)
Re: [PATCH] Detached HEAD (experimental), J. Bruce Fields, (Tue Jan 9, 2:53 pm)
Re: [PATCH] Detached HEAD (experimental), Junio C Hamano, (Tue Jan 9, 3:37 pm)
Re: [PATCH] Detached HEAD (experimental), Shawn O. Pearce, (Tue Jan 9, 4:39 pm)
Re: [PATCH] Detached HEAD (experimental), Shawn O. Pearce, (Tue Jan 9, 4:44 pm)
Re: [PATCH] Detached HEAD (experimental), Linus Torvalds, (Tue Jan 9, 4:46 pm)
Re: [PATCH] Detached HEAD (experimental), Junio C Hamano, (Tue Jan 9, 5:10 pm)
Re: [PATCH] Detached HEAD (experimental), Shawn O. Pearce, (Tue Jan 9, 5:18 pm)
Re: [PATCH] Detached HEAD (experimental), Carl Worth, (Tue Jan 9, 5:51 pm)
Re: [PATCH] Detached HEAD (experimental), Linus Torvalds, (Tue Jan 9, 5:54 pm)
Re: [PATCH] Detached HEAD (experimental), Junio C Hamano, (Wed Jan 10, 1:02 am)
Re: [PATCH] Detached HEAD (experimental), Andy Parkins, (Wed Jan 10, 2:04 am)
Re: [PATCH] Detached HEAD (experimental), Shawn O. Pearce, (Wed Jan 10, 2:05 am)
Re: [PATCH] Detached HEAD (experimental), Andreas Ericsson, (Wed Jan 10, 2:08 am)
Re: [PATCH] Detached HEAD (experimental), Junio C Hamano, (Wed Jan 10, 2:33 am)
Re: [PATCH] Detached HEAD (experimental), Junio C Hamano, (Wed Jan 10, 2:40 am)
Re: [PATCH] Detached HEAD (experimental), Junio C Hamano, (Wed Jan 10, 2:46 am)
Re: [PATCH] Detached HEAD (experimental), Andy Parkins, (Wed Jan 10, 3:10 am)
Re: [PATCH] Detached HEAD (experimental), Shawn O. Pearce, (Wed Jan 10, 3:25 am)
Re: [PATCH] Detached HEAD (experimental), Jeff King, (Wed Jan 10, 7:04 am)
Re: [PATCH] Detached HEAD (experimental), Junio C Hamano, (Wed Jan 10, 9:18 am)
Re: [PATCH] Detached HEAD (experimental), Daniel Barkalow, (Wed Jan 10, 9:30 am)
Re: [PATCH] Detached HEAD (experimental), Junio C Hamano, (Wed Jan 10, 5:34 pm)
Re: [PATCH] Detached HEAD (experimental), J. Bruce Fields, (Wed Jan 10, 9:31 pm)
Re: [PATCH] Detached HEAD (experimental), Andreas Ericsson, (Thu Jan 11, 2:45 am)