From: Junio C Hamano <gitster@pobox.com>
To: martin f krafft <madduck@debian.org>
Cc: Jeff King <peff@peff.net>,
"Aneesh Kumar K.V" <aneesh.kumar@linux.vnet.ibm.com>,
Aneesh Kumar <aneesh.kumar@gmail.com>,
git@vger.kernel.org, pasky@suse.cz
Subject: Re: [topgit] tg update error
Date: Thu, 12 Feb 2009 23:32:54 -0800 [thread overview]
Message-ID: <7vmycqeqqh.fsf@gitster.siamese.dyndns.org> (raw)
In-Reply-To: <20090213062818.GB16434@piper.oerlikon.madduck.net> (martin f. krafft's message of "Fri, 13 Feb 2009 07:28:18 +0100")
martin f krafft <madduck@debian.org> writes:
> also sprach Junio C Hamano <gitster@pobox.com> [2009.02.13.0014 +0100]:
>> > TopGit would need to make a proper branch, merge the bases into
>> > it, merge that branch into the topic branch, and the probably
>> > delete the branch pointer, as it's no longer needed and would
>> > only pollute the refs/heads/* namespace.
>>
>> So it happens purely inside TopGit and the end user never sees
>> a state that HEAD points outside refs/heads/, right?
>
> Yes.
Now I am confused by your answers. This "Yes" means that setting HEAD
outside refs/heads/ happens purely as an intermediate state to avoid
setting HEAD to some branch ref. After the operation finishes correctly,
HEAD will never be left outside refs/heads/. But this contradicts
directly with what you say next.
>> Why can't the base flipping operation you descibed be done on
>> detached HEAD? Perhaps with a shell variable or two that hold
>> commit object names you need to keep track of while it is doing is
>> work?
>
> I am not sure I understand. Isn't that what's currently happening?
If you *are* setting HEAD to some ref that is outside refs/heads (or even
inside refs/heads for that matter), at that point the HEAD is *not*
detached, so no, it obviously is *not* what is happening.
I am asking why you need to use a ref to do that, *if* it is a tentative
state while the program is running. You are probably calling a git
plumbing or Porcelain command that updates HEAD, and the reason why you
point HEAD outside refs/heads/ is beause you would want the command you
call to update one of the refs/top-bases/ ref through HEAD. I am asking
why you are not running these commands on a normal detached HEAD, and then
use update-ref (not symbolic-ref) plumbing to update the refs/top-bases/
ref you would want to update when it is done.
>> You did not actually answer a larger question.
>
> It wasn't asked to me before... ;)
Go back to the original message and read it again.
> Up until now, however,
>
> git checkout -q "refs/top-bases/$name"
>
> was not really something undocmented or restricted.
Giving checkout anything that is not "a branch name" meant detaching HEAD
ever since detached HEAD was introduced, and that is a documented feature.
git checkout "refs/heads/master" would behave the same way --- it won't
check out the 'master' branch.
> I can still call e.g. git update-ref (as opposed to e.g. git
> _update-ref) and potentially turn my repository upside down
> exemplifies this.
The distinction between Porcelain and plumbing is unfortunately not very
clear at places. The change we reverted was probably a bad one. The
stricter check was not done at the Porcelain level but was done at the
plumbing level.
next prev parent reply other threads:[~2009-02-13 7:36 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-02-12 8:09 [topgit] tg update error Aneesh Kumar
2009-02-12 8:48 ` martin f krafft
2009-02-12 9:25 ` Aneesh Kumar K.V
2009-02-12 9:32 ` martin f krafft
2009-02-12 10:12 ` Aneesh Kumar K.V
2009-02-12 11:29 ` Bert Wesarg
2009-02-12 12:56 ` Jeff King
2009-02-12 12:59 ` Jeff King
2009-02-12 21:01 ` martin f krafft
2009-02-12 21:01 ` Junio C Hamano
2009-02-12 21:41 ` martin f krafft
2009-02-12 23:14 ` Junio C Hamano
2009-02-13 6:28 ` martin f krafft
2009-02-13 7:32 ` Junio C Hamano [this message]
2009-02-13 9:04 ` Junio C Hamano
2009-02-13 18:26 ` Jeff King
2009-02-14 2:02 ` Junio C Hamano
2009-02-14 2:08 ` Jeff King
2009-02-14 2:16 ` Junio C Hamano
2009-02-14 2:24 ` Jeff King
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=7vmycqeqqh.fsf@gitster.siamese.dyndns.org \
--to=gitster@pobox.com \
--cc=aneesh.kumar@gmail.com \
--cc=aneesh.kumar@linux.vnet.ibm.com \
--cc=git@vger.kernel.org \
--cc=madduck@debian.org \
--cc=pasky@suse.cz \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).