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
 
(9 intermediate revisions by 3 users not shown)
Line 1: Line 1:
__TOC__
+
<small>''(Updated: Dec 2009)''</small>
To migrate ongoing work from CVS to Git SCM, you will first convert your work to a patch and then apply that patch to a Git tree as described in the procedures below.
+
 
== Converting your work to patches ==
+
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 convert your work to patches, follow one of these procedures.
+
== Convert your work to patches ==
==== For work that does ''NOT'' live in a private CVS branch... ====
+
=== Work that does ''NOT'' live in a private CVS branch ===
If you maintain your development code with Quilt or something other than a CVS private branch, generate patches for any current work.
+
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
 
  cvs diff > my.patch
  
==== For work in a private CVS branch... ====
+
=== Work from a private CVS branch ===
If your work resides in a private CVS branch, create a fork from the branch as follows:
+
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:
 
 
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
 
  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'').
+
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.  
+
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.
 
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.
  
== Applying your patches to a Git repo ==
+
== Apply your patches to a git repo ==
To apply a patch to a Git repo, complete these steps.
+
Obtain a clone of the [[Accessing Lustre Code | Lustre repository]].
 
 
1. Obtain a clone of the [https://wikis.lustre.org/intra/index.php/Lustre_GIT#Getting_the_Lustre_repository 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>
 
+
Create your own private branch.  For example, a branch for bug 20000 based off of HEAD:
2. Create your own private branch.  For example, create a branch for bug 20000 based off of HEAD by entering:
 
 
  git checkout -b bug20000 master
 
  git checkout -b bug20000 master
 
+
Apply the patch to that branch
3. Apply the patch to that branch.
 
 
  patch -p1 < hd_params_tree.patch
 
  patch -p1 < hd_params_tree.patch
 
+
Resolve any merge conflicts, and commit the patch (to your branch)
4. Resolve any merge conflicts and commit the patch (to your branch).
 
 
  git commit -a -v
 
  git commit -a -v
  
== Continuing Development ==
+
== Continue development ==
If you are an external contributor, follow the procedure for [http://wiki.lustre.org/index.php/Submitting_Patches submitting patches].
+
Sun employees should continue development under git as per the [https://wikis.lustre.org/intra/index.php/Lustre_GIT Lustre GIT page].
  
If you are a Sun employee, continue development under Git as described on the [https://wikis.lustre.org/intra/index.php/Lustre_GIT Lustre GIT page].
+
External contributors should follow the procedure for [[Submitting_Patches|submitting patches]].

Latest revision as of 14: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.