Re: [PATCH] Show an example of deleting commits with git-rebase.

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

 



Michael S. Tsirkin wrote:
> Shawn O. Pearce <spearce@xxxxxxxxxxx> wrote:

>> Subject: [PATCH] Show an example of deleting commits with git-rebase.
>> 
>> +A range of commits could also be removed with rebase.  If we have
>> +the following situation:
>> +
>> +------------
>> +    E---F---G---H---I---J  topicA
>> +------------
>> +
>> +then the command
>> +
>> +    git-rebase --onto topicA~5 topicA~2 topicA
>> +
>> +would result in the removal of commits F and G:
>> +
>> +------------
>> +    E---H'---I'---J'  topicA
>> +------------
>> +
>> +This is useful if F and G were flawed in some way, or should not be
>> +part of topicA.  Note that the argument to --onto and the <upstream>
>> +parameter can be any valid commit-ish.
>> +
> 
> Good clarification, a couple of comments:
> - The use of <branch> is more confusing than useful in this case.
>   You can always just do
>       git reset --hard topicA
>       git rebase --onto topicA~5 topicA~2
>   instead, correct?

I disagree. In my opinion using of <branch> makes it more clear: which
branch we are rebasing, and range of commits moved.
 
> - The use of ~ notation here is also more scary than clarifying.
>    git rebase --onto F H
>   will be clearer I think.

I agree.
-- 
Jakub Narebski
Warsaw, Poland
ShadeHawk on #git


-
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]