Re: Editing the root commit

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Chris Webb <chris@xxxxxxxxxxxx> writes:

> The first is whether there's a clever symbolic way to refer to the root of
> the current branch, rather than tailing git log output? gitrevisions(7)
> doesn't obviously suggest one.

There is not, for a few good reasons.

The very first commit is no more special than any other commit in
the history.  Some projects may start with "the first working
version", in which case there may be some value to be able to refer
to it, while some other projects may start with "the initial
snapshot" whose specialness comes _only_ from it being the first
one.

"The first working version" specialness may deserve to be tagged,
and in that case you would already have a name to refer to it.  If
on the other hand the first one isn't even worth to be tagged, it
does not deserve to waste a short-hand to refer to it at the
machinery level.  So there is nothing listed in the gitrevisions(7)
for it.

Also there is a more important question: Which root commit?  There
does not necessarily have to be a single "the root" commit in the
history.

>   git checkout --orphan rewritten
>   git rm -rf
>   git rebase --interactive --root --onto rewritten master

The argument to "--onto" must be a commit, but "checkout --orphan"
is not a way to create a commit; it is a way to bring you to a state
without any commit.

I personally think "git rebase -i --root" should be made to just
work without requiring "--onto" and let you "edit" even the first
one in the history. It is understandable that nobody bothered, as
people are a lot less often rewriting near the very beginning of the
history than otherwise.

Even though I wouldn't bother doing this myself, I wouldn't mind
reviewing a patch series ;-)
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]