WARNING: This is the _old_ Lustre wiki, and it is in the process of being retired. The information found here is all likely to be out of date. Please search the new wiki for more up to date information.

Difference between revisions of "Migrating to Git"

From Obsolete Lustre Wiki
Jump to navigationJump to search
 
(12 intermediate revisions by 3 users not shown)
Line 1: Line 1:
 +
<small>''(Updated: Dec 2009)''</small>
 +
 
To migrate ongoing work from CVS to git SCM, first convert your work to a patch, then apply that patch to a git tree.
 
To migrate ongoing work from CVS to git SCM, first convert your work to a patch, then apply that patch to a git tree.
 
== Convert your work to patches ==
 
== Convert your work to patches ==
Line 15: Line 17:
  
 
== Apply your patches to a git repo ==
 
== Apply your patches to a git repo ==
Obtain a clone of the [https://wikis.lustre.org/intra/index.php/Lustre_GIT#Getting_the_Lustre_repository lustre repository].
+
Obtain a clone of the [[Accessing Lustre Code | Lustre repository]].
 
  git clone --origin prime git@git.lustre.org:prime/lustre <mydir>
 
  git clone --origin prime git@git.lustre.org:prime/lustre <mydir>
 
  cd <mydir>
 
  cd <mydir>
Line 28: Line 30:
 
Sun employees should continue development under git as per the [https://wikis.lustre.org/intra/index.php/Lustre_GIT Lustre GIT page].
 
Sun employees should continue development under git as per the [https://wikis.lustre.org/intra/index.php/Lustre_GIT Lustre GIT page].
  
External contributors should follow the procedure for [http://wiki.lustre.org/index.php/Submitting_Patches submitting patches].
+
External contributors should follow the procedure for [[Submitting_Patches|submitting patches]].

Latest revision as of 15:53, 20 May 2010

(Updated: Dec 2009)

To migrate ongoing work from CVS to git SCM, first convert your work to a patch, then apply that patch to a git tree.

Convert your work to patches

Work that does NOT live in a private CVS branch

If you maintain your development code with quilt or something else other than a CVS private branch, generate patches for any current work.

cvs diff > my.patch

Work from a private CVS branch

1. In your branch CVS working tree, use 'cvs diff' against the base tree divergence point. Since you've been using the build/merge scripts, this is quite easy. For example, params tree branch:

cvs diff -r HD_PARAMS_TREE_BASE > hd_params_tree.patch

The merge scripts have kept the <branchname>_BASE tag updated to reflect the latest merge (don't use an old dated tag, use the one ending in _BASE).

This cvs diff will include uncommitted changes in your working tree as well as all your committed code, so make sure your working directory tree is in the state you want.

2. Inspect your patch to make sure it is correct. It will be a patch against the divergence point, so realize that the base branch may have moved on and your patch may have to be updated when you apply it.

Apply your patches to a git repo

Obtain a clone of the Lustre repository.

git clone --origin prime git@git.lustre.org:prime/lustre <mydir>
cd <mydir>

Create your own private branch. For example, a branch for bug 20000 based off of HEAD:

git checkout -b bug20000 master

Apply the patch to that branch

patch -p1 < hd_params_tree.patch

Resolve any merge conflicts, and commit the patch (to your branch)

git commit -a -v

Continue development

Sun employees should continue development under git as per the Lustre GIT page.

External contributors should follow the procedure for submitting patches.