git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Junio C Hamano <gitster@pobox.com>
Cc: Dave Olszewski <cxreg@pobox.com>, git@vger.kernel.org
Subject: Re: [PATCH] rebase--interactive: don't enforce valid branch
Date: Sun, 14 Mar 2010 23:14:26 -0700	[thread overview]
Message-ID: <7vd3z6f6wt.fsf@alter.siamese.dyndns.org> (raw)
In-Reply-To: <7vvdcygmz8.fsf@alter.siamese.dyndns.org> (Junio C. Hamano's message of "Sun\, 14 Mar 2010 22\:42\:03 -0700")

Junio C Hamano <gitster@pobox.com> writes:

> Dave Olszewski <cxreg@pobox.com> writes:
>
>>>> +test_expect_success 'rebase while detaching HEAD' '
>>>> +	grandparent=$(git rev-parse HEAD~2) &&
>>>> +	test_tick &&
>>>> +	FAKE_LINES="2 1" git rebase -i HEAD~2 HEAD^0 &&
>>>
>>> What's the point of saying this?  You could instead say:
>>>
>>> 	git rebase -i HEAD~2
>>>
>>> no?
>> ...

Ahh, Ok, the point is that when we start this sequence we are on a branch,
and then you want to end up on a detached HEAD that points at the result
of the branch.

I'll queue it in 'pu', but with a little tweak to the test to make it
clear what is going on, perhaps like this.

    test_expect_success 'rebase while detaching HEAD' '
            git symbolic-ref HEAD &&
            grandparent=$(git rev-parse HEAD~2) &&
            test_tick &&
            FAKE_LINES="2 1" git rebase -i HEAD~2 HEAD^0 &&
            test $grandparent = $(git rev-parse HEAD~2) &&
            test_must_fail git symbolic-ref HEAD
    '

We may need to document this behaviour, by the way, if we make it official
that the extra "branch to be rewritten" parameter can be a non-branch.
Two points are that you can give arbitrary commit, and that you will end
up with a detached HEAD that points at the result if you did so.

Also I did't followed the code, but does it behave sanely when you say
"rebase --abort"?

  parent reply	other threads:[~2010-03-15  6:14 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-03-15  4:48 [PATCH] rebase--interactive: don't enforce valid branch Dave Olszewski
2010-03-15  5:20 ` Junio C Hamano
2010-03-15  5:28   ` Dave Olszewski
2010-03-15  5:42     ` Junio C Hamano
2010-03-15  5:46       ` Dave Olszewski
2010-03-15  6:14       ` Junio C Hamano [this message]
2010-03-15  8:41         ` Dave Olszewski
2010-03-15 17:14           ` Junio C Hamano

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=7vd3z6f6wt.fsf@alter.siamese.dyndns.org \
    --to=gitster@pobox.com \
    --cc=cxreg@pobox.com \
    --cc=git@vger.kernel.org \
    /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).