Re: Editing the root commit
- From
Chris Webb <chris@arachsys.com>
- Date
- Jun 20, 2012, 09:32 UTC
- Message-ID
- <20120620093205.GB10579@arachsys.com>
- In-Reply-To
- <20120619111709.GC10692@arachsys.com>
Chris Webb <chris@arachsys.com> writes:
Show 6 quoted lines
> Junio C Hamano <gitster@pobox.com> 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.