Difference between revisions of "Subversion to Git Conversion: Notes on the Details"

From GlueXWiki
Jump to: navigation, search
(The Procedure)
(Prepare Translation of Author Information)
Line 10: Line 10:
  
 
* Used an "authors" file in /home/marki/.svn2git as described in README.
 
* Used an "authors" file in /home/marki/.svn2git as described in README.
* Wrote script [https://gist.github.com/markito3/a1865019f9d600f8e897#file-user_list_svn_convert-pl user_list_svn_convert.pl] to extract all usernames in the "halld" group at JLab and put them into the "authors" file. Creates email address by appending "@jlab.org" in '''all''' cases. If any authors are missing in the file, svn2git will exit and report the error.
+
* Wrote script [https://gist.github.com/markito3/a1865019f9d600f8e897#file-user_list_svn_convert-pl user_list_svn_convert.pl] to extract all usernames in the "halld" group at JLab and put them into the "authors" file. Creates email address by appending "@jlab.org" in '''all''' cases. If any authors are missing in the file, svn2git will exit and report the omission as an error.
  
 
==Subversion State at Conversion==
 
==Subversion State at Conversion==

Revision as of 10:47, 6 August 2015

Main reference: svn2git README file, hereafter referred to as README.

Preliminaries

Install svn2git

Follow instructions in README.

Prepare Translation of Author Information

  • Used an "authors" file in /home/marki/.svn2git as described in README.
  • Wrote script user_list_svn_convert.pl to extract all usernames in the "halld" group at JLab and put them into the "authors" file. Creates email address by appending "@jlab.org" in all cases. If any authors are missing in the file, svn2git will exit and report the omission as an error.

Subversion State at Conversion

The last revision in the Subversion repository before conversion: Rev 19042 2015-07-15 17:35:06

The Procedure

Details of the steps are described in README.

  1. Delete the practice repositories on GitHub.
  2. Create a blank repository to receive the converted repository on GitHub.
  3. Make a copy of the complete Subversion repository on the local disk with rsync.
  4. Use svn2git to do the conversion using the local-disk-resident version of the Subversion repository.
  5. In the resulting git repository, delete branches and tags not related to the package, as well as all "@revision" branches and tags.
  6. Clone a bare copy of the repository (--bare option).
  7. Push the bare copy to the GitHub repository with the --mirror option.
  8. Add repositories to the list of those owned by the gluex team on GitHub.

The sim-recon conversion with svn2git took about 8 hours. Hdds took about 20 hours.

Command Syntax

The magic command to convert from subversion to git:

cd /path/to/conversion
svn2git https://halldsvn.jlab.org/repos --no-minimize-url -v --trunk trunk/sim-recon --branches branches --tags tags

To prepare local repository for import to GitHub:

cd /path/to/clone
git clone --bare file:///path/to/conversion

To do the import, from the local host:

cd /path/to/clone/conversion.git git push --mirror https://github.com/jeffersonlab/sim-recon.git