hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Apache Wiki <wikidi...@apache.org>
Subject [Hadoop Wiki] Update of "MigratingPrivateGitBranches" by SteveLoughran
Date Tue, 02 Sep 2014 11:12:09 GMT
Dear Wiki user,

You have subscribed to a wiki page or wiki category on "Hadoop Wiki" for change notification.

The "MigratingPrivateGitBranches" page has been changed by SteveLoughran:

Detailed instructions on how to move from existing branches to the new repository

New page:
= Migrating Private Git Branches =

Summary: use {{{git format-patch}}} then {{{git am -3 }}} to get your work atop the new Apache
Hadoop git repository

The checksums of all the commits have changed, you can't rebase against the new trunk unless
you want to suddenly get stuck trying to resolve conflict in ivy.xml files of branch 0.17.

If you have a set of commits rebased against a recent version of the (old) git.apache.org
trunk, here's how to get it onto the new branch without losing all your commit history.

== Preparing ==

Check in all your work.

Tag the final commit. This lets you get back if anything goes wrong:

(assuming {{{$JIRA}}} is set to your JIRA, or you are going to manually insert it)

> git tag tag_$JIRA_pre_migrate

Note the checksum of the last commit of the old tree ''before your commits''. For me —and
presumably others —this is  42a61

Tag it:

> git tag tag_final_old_trunk 42a61

Note the text of it

(HDFS-6899. Allow changing MiniDFSCluster volumes per DN and capacity per volume. (Arpit Agarwal))

== Export your patches ==

Create a formatted patch sequence of all your commits

> git format-patch  --diff-algorithm=minimal -M --keep-subject --stdout  42a61 > changes.mbox

This is a history of all the changes. But: it cannot be applied to the new trunk directly
as everything has changed. You need to merge it via the body of each patch, rather than against
the commit IDs.

== Import ==

Add the new remote https://git-wip-us.apache.org/repos/asf/hadoop.git  as {{{asflive}}}

git remote add https://git-wip-us.apache.org/repos/asf/hadoop.git asflive

Check out {{{asflive/trunk}}} to new branch {{{live/trunk}}}

> git checkout -b live/trunk --track asflive/trunk

Locate the commit which matches the commit #41a61 in the old trunk

> git log --grep HDFS-6899

commit e871955765a5a40707e866179945c5dc4fefd389
Author: Arpit Agarwal <arp@apache.org>
Date:   Sat Aug 23 06:01:17 2014 +0000

    HDFS-6899. Allow changing MiniDFSCluster volumes per DN and capacity per volume. (Arpit

    git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/trunk@1619970 13f79535-47bb-0310-9956-ffa450edef68


Now checkout a branch off that revision

> git checkout -b svntrunk e871955765

Verify the log contains your last commits

> git log ^3

Tag this as {{{tag_svntrunk}}}

 > git tag tag_svntrunk

Check out a new branch for your merge

> git checkout -b merge/$JIRA

apply the merge
> git am -3 < changes.mbox

Verify that its log matches the last few of your original branch

> git log ^5

Tag this

> git tag tag_$JIRA_merged

== Rebase and catch up ==

Now rebase this branch onto the full live trunk

git rebase asflive/trunk

Fix any problems you hit as you would on any other rebase. (for me it's invariably .pom files)

'''Maybe:''' rename the new branch to whatever you want to work with. You can also delete
the original branch with a {{{git delete --force}}}; the tag you made ensures that it is still
somewhere in your history.

Repeat for all other branches you've made. It is best to get this over with in one go.

== Finishing the migration ==

After you have have migrated all the branches you want to, you can clean up the branches.

Drop the old remote (assuming it was called {{{origin}}})

> git remote remove origin

Rename {{{asflive}}}

> git remote rename asflive origin

You are now ready to get back to work!

View raw message