From: Andreas Ericsson <ae@op5.se>
To: Daniel Barkalow <barkalow@iabervon.org>
Cc: Junio C Hamano <junkio@cox.net>,
"J. Bruce Fields" <bfields@fieldses.org>,
Jeff King <peff@peff.net>, Carl Worth <cworth@cworth.org>,
git@vger.kernel.org
Subject: Re: [PATCH] Detached HEAD (experimental)
Date: Thu, 11 Jan 2007 10:45:26 +0100 [thread overview]
Message-ID: <45A60736.4050503@op5.se> (raw)
In-Reply-To: <Pine.LNX.4.64.0701101041210.20138@iabervon.org>
Daniel Barkalow wrote:
> On Wed, 10 Jan 2007, Junio C Hamano wrote:
>
>> Andreas Ericsson <ae@op5.se> writes:
>>
>>> ... Since committing on
>>> detached heads really should be a very rare case I don't think many
>>> people will find this terribly annoying.
>> Quite the contrary, I would imagine it would be quite natural to
>> do throw-away commits and merges on detached head while
>> bisecting the history (e.g. commit small fixup to make it
>> compile and then mark the result for bisection to hunt for real
>> bugs that are hidden by silly compilation problems).
>
> 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.
>
Same here. I'd imagine temporary build-fixes to live as a patch-file
generated by
git diff > build-fixes.diff
after having hacked on the tree. There's no sane way of inserting
commits into the middle of the DAG, so committing on something that
isn't a branch with the intention of losing it is just plain weird.
> (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.)
>
Yes. I'd imagine "git merge --no-commit" could be used for this, to
merge things only in the working directory.
> 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.
>
Perhaps, but this is also a bit weird, as you would normally hack things
up to fit on top of some already existing branch, so then you'd detach
the head but point it to something that already has a branch-name
associated with it.
Otoh, I could imagine this would be sort of nifty for applying bugfixes
on top of old tags, so perhaps it's not so weird after all. Then you'd
probably want to create a new tag before releasing the bugfixed version,
so Linus suggestion makes sense in this case (assuming it doesn't fsck
up the bisect case, ofc).
> 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).
>
Yes. I'd imagine "git merge --no-commit" could be used for this, to
merge things only in the working directory. We could easily create a
hack for this by doing a "git reset --mixed HEAD^1" after the merge is
complete.
> 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.
>
Agreed. They really are two completely different things. I see no harm
in splitting them up codewise. Bisect could start working without its
protected branch straight away, but commits (and merges) to detached
heads wouldn't work at all. Then we can see what use people put this to
and what walls they run into and make the feature accordingly.
--
Andreas Ericsson andreas.ericsson@op5.se
OP5 AB www.op5.se
Tel: +46 8-230225 Fax: +46 8-230231
next prev parent reply other threads:[~2007-01-11 9:45 UTC|newest]
Thread overview: 68+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-01-02 7:45 [PATCH] Detached HEAD (experimental) Junio C Hamano
2007-01-02 19:59 ` Edgar Toernig
2007-01-02 21:56 ` Carl Worth
2007-01-02 22:18 ` Jakub Narebski
2007-01-03 0:34 ` Carl Worth
2007-01-06 18:58 ` J. Bruce Fields
2007-01-06 20:48 ` Alan Chandler
2007-01-06 22:52 ` J. Bruce Fields
2007-01-02 22:44 ` Junio C Hamano
2007-01-02 23:34 ` Carl Worth
2007-01-03 2:45 ` Junio C Hamano
2007-01-08 11:19 ` Junio C Hamano
2007-01-08 13:17 ` Jeff King
2007-01-09 0:19 ` Junio C Hamano
2007-01-09 0:43 ` Carl Worth
2007-01-09 1:05 ` Junio C Hamano
2007-01-09 1:15 ` Carl Worth
2007-01-09 3:26 ` Shawn O. Pearce
2007-01-09 7:07 ` Junio C Hamano
2007-01-09 10:41 ` [PATCH 0/6] Expose in_merge_bases() via merge-base Junio C Hamano
2007-01-09 8:12 ` [PATCH] Detached HEAD (experimental) Luben Tuikov
2007-01-09 14:21 ` Jeff King
2007-01-09 21:20 ` Junio C Hamano
2007-01-09 21:31 ` J. Bruce Fields
2007-01-09 21:43 ` Carl Worth
2007-01-09 21:53 ` J. Bruce Fields
2007-01-09 23:44 ` Shawn O. Pearce
2007-01-10 0:26 ` Jakub Narebski
2007-01-10 0:34 ` Shawn O. Pearce
2007-01-10 1:03 ` J. Bruce Fields
2007-01-10 1:07 ` Shawn O. Pearce
2007-01-10 1:15 ` Nicolas Pitre
2007-01-10 1:24 ` Junio C Hamano
2007-01-10 1:40 ` Shawn O. Pearce
2007-01-10 1:54 ` Nicolas Pitre
2007-01-10 2:28 ` Shawn O. Pearce
2007-01-10 1:37 ` Jakub Narebski
2007-01-10 9:08 ` Andreas Ericsson
2007-01-10 9:46 ` Junio C Hamano
2007-01-10 16:30 ` Daniel Barkalow
2007-01-11 9:45 ` Andreas Ericsson [this message]
2007-01-10 9:40 ` Junio C Hamano
2007-01-09 22:37 ` Junio C Hamano
2007-01-09 23:39 ` Shawn O. Pearce
2007-01-09 23:46 ` Linus Torvalds
2007-01-10 0:10 ` Junio C Hamano
2007-01-10 0:18 ` Shawn O. Pearce
2007-01-10 0:54 ` Linus Torvalds
2007-01-10 0:51 ` Carl Worth
2007-01-10 8:02 ` Junio C Hamano
2007-01-10 9:04 ` Andy Parkins
2007-01-10 9:05 ` Shawn O. Pearce
2007-01-10 9:33 ` Junio C Hamano
2007-01-10 10:10 ` Andy Parkins
2007-01-10 10:25 ` Shawn O. Pearce
2007-01-10 16:18 ` Junio C Hamano
2007-01-10 14:04 ` Jeff King
2007-01-11 0:34 ` Junio C Hamano
2007-01-11 4:31 ` J. Bruce Fields
2007-01-03 10:46 ` Jeff King
2007-01-03 11:59 ` Jeff King
2007-01-02 23:22 ` [PATCH] git-branch: show detached HEAD Lars Hjemli
2007-01-03 5:18 ` Shawn O. Pearce
2007-01-03 6:53 ` Junio C Hamano
2007-01-03 7:50 ` Lars Hjemli
2007-01-03 7:52 ` Junio C Hamano
2007-01-03 7:05 ` Junio C Hamano
2007-01-03 7:37 ` Lars Hjemli
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=45A60736.4050503@op5.se \
--to=ae@op5.se \
--cc=barkalow@iabervon.org \
--cc=bfields@fieldses.org \
--cc=cworth@cworth.org \
--cc=git@vger.kernel.org \
--cc=junkio@cox.net \
--cc=peff@peff.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.