Subject: Re: Editing the root commit

From: Chris Webb <[email-masked]>
Date: Wed, 20 Jun 2012 10:32:05 +0100

Chris Webb <[email-masked]> writes:

> Junio C Hamano <[email-masked]> writes:
>
> > Even though I wouldn't bother doing this myself, I wouldn't mind
> > reviewing a patch series ;-)
> 
> Okay, I'll take a look when I finish my current project!

I had a bit of spare time this morning and had a quick look through
git-rebase--interactive.sh.

Apart from the validation, message and reflog code in git-rebase.sh and
git-rebase--interactive.sh that would need fixing up to know about this
case, the essence of this seems to be starting with an orphan commit instead
of a commit descended from $onto right at the end of --interactive.

I'd love to write something like

  git checkout ${onto:---orphan}

(or a variant) but can git be persuaded to have an orphan detached HEAD like
that?

An orphan branch appears to involve HEAD containing 'ref: refs/heads/foo'
where refs/heads/foo doesn't exist yet, but I get 'not a git repo' instead
of an orphan detached HEAD with either :>.git/HEAD or rm .git/HEAD.

Cheers,

Chris.