Looking for patch rebasing advice

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Looking for patch rebasing advice

Will Fiveash-2
In case someone has already figured out how to do this I would love to
know the best way to use git to rebase a set of OS specific source
patches say from MIT krb5 v1.14.2 to v1.14.3 (the patches apply cleanly
to 1.14.2).  What I've come across on the Internet that seems relevant
is: http://bec-systems.com/site/247/howto-use-a-git-topic-branch but
since I don't know git I'm not sure if those instructions are accurate.
So far I have done the following using an up to date clone of my krb5
repo fork of MIT's krb5:

1. cd into my local cloned repo and create a branch that has all the
   commits up to krb5-1.14.2-final (is this correct?):

$ git checkout -b krb5-1.14.2 krb5-1.14.2-final

2. With krb5-1.14.2 as the checked out branch do a git apply and git
   commit -a for each patch to be rebased so there is a separate commit
   in this branch for each patch.

At this point it's unclear to me as to whether I need to create another
branch based on the krb5-1.14.3-final tag and what command I should use
to rebase the patches.  Clear guidance for a git novice would be
appreciated.

--
Will Fiveash
Oracle Solaris Software Engineer
_______________________________________________
krbdev mailing list             [hidden email]
https://mailman.mit.edu/mailman/listinfo/krbdev
Reply | Threaded
Open this post in threaded view
|

Re: Looking for patch rebasing advice

Greg Hudson
On 07/28/2016 01:19 PM, Will Fiveash wrote:
> $ git checkout -b krb5-1.14.2 krb5-1.14.2-final
[...]
> 2. With krb5-1.14.2 as the checked out branch do a git apply and git
>    commit -a for each patch to be rebased so there is a separate commit
>    in this branch for each patch.
>
> At this point it's unclear to me as to whether I need to create another
> branch based on the krb5-1.14.3-final tag and what command I should use
> to rebase the patches.

You probably do want to create another branch.  The following should
create a krb5-1.14.3 branch and copy all of the downstream commits you
made on the krb5-1.14.2 branch:

    git checkout -b krb5-1.14.3 krb5-1.14.3-final
    git cherry-pick krb5-1.14.2-final..krb5-1.14.2

This isn't a "rebase" operation since you're copying the commits, not
modifying an existing branch.

(You might consider naming the downstream branches more explicitly, like
krb5-1.14.2-oracle, but that's up to you.)
_______________________________________________
krbdev mailing list             [hidden email]
https://mailman.mit.edu/mailman/listinfo/krbdev
Reply | Threaded
Open this post in threaded view
|

Re: Looking for patch rebasing advice

Will Fiveash-2
On Thu, Jul 28, 2016 at 02:01:57PM -0400, Greg Hudson wrote:

> You probably do want to create another branch.  The following should
> create a krb5-1.14.3 branch and copy all of the downstream commits you
> made on the krb5-1.14.2 branch:
>
>     git checkout -b krb5-1.14.3 krb5-1.14.3-final
>     git cherry-pick krb5-1.14.2-final..krb5-1.14.2
>
> This isn't a "rebase" operation since you're copying the commits, not
> modifying an existing branch.
>
> (You might consider naming the downstream branches more explicitly, like
> krb5-1.14.2-oracle, but that's up to you.)

I took your advice and created a krb5-1.14.2-oracle branch, added and
committed all the Solaris specific patches to that branch, created and
checked out a krb5-1.14.3-oracle branch then ran:

git cherry-pick krb5-1.14.2-final..krb5-1.14.2-oracle

which appears to have updated most the Solaris patch commits so they
apply cleanly on the krb5-1.14.3-oracle branch.  I did have to manually
resolve one cherry-pick conflict but that was no big deal.

--
Will Fiveash
Oracle Solaris Software Engineer
_______________________________________________
krbdev mailing list             [hidden email]
https://mailman.mit.edu/mailman/listinfo/krbdev