From d6737ea97c6ad046301ca58f7aab53eeab30998d Mon Sep 17 00:00:00 2001 From: mhagger Date: Wed, 18 Jan 2012 05:44:15 +0000 Subject: [PATCH] Change the cvs2git instructions to use a bare repository. In the instructions for using cvs2git, have the user create a bare (rather than non-bare) repository for "git fast-import"ing into. (1) Most people will want a bare repository to put on their server. (2) Using a bare repository avoids the awkwardness of having to check out the source tree explicitly (and otherwise having "git status" report that all files have been deleted). git-svn-id: http://cvs2svn.tigris.org/svn/cvs2svn/trunk@5372 be7e6eca-30d4-0310-a8e5-ac0d63af7087 --- run-tests.py | 21 ++++++++++----------- www/cvs2git.html | 25 +++++++++++++++++-------- 2 files changed, 27 insertions(+), 19 deletions(-) diff --git a/run-tests.py b/run-tests.py index 0ee438d2..bf3761f5 100755 --- a/run-tests.py +++ b/run-tests.py @@ -3451,27 +3451,26 @@ def main_git(): # Note: To test importing into git, do # - # ./run-tests - # rm -rf .git - # git-init - # cat cvs2svn-tmp/{blobfile,dumpfile}.out | git fast-import + # ./run-tests + # rm -rf cvs2svn-tmp/main.git + # git init --bare cvs2svn-tmp/main.git + # cd cvs2svn-tmp/main.git + # cat ../git-{blob,dump}.dat | git fast-import # # Or, to load the dumpfiles separately: # - # cat cvs2svn-tmp/git-blob.dat \ - # | git fast-import --export-marks=cvs2svn-tmp/git-marks.dat - # cat cvs2svn-tmp/git-dump.dat \ - # | git fast-import --import-marks=cvs2svn-tmp/git-marks.dat + # cat ../git-blob.dat | git fast-import --export-marks=../git-marks.dat + # cat ../git-dump.dat | git fast-import --import-marks=../git-marks.dat # # Then use "gitk --all", "git log", etc. to test the contents of the - # repository. + # repository or "git clone" to make a non-bare clone. # We don't have the infrastructure to check that the resulting git # repository is correct, so we just check that the conversion runs # to completion: conv = GitConversion('main', None, [ - '--blobfile=cvs2svn-tmp/blobfile.out', - '--dumpfile=cvs2svn-tmp/dumpfile.out', + '--blobfile=cvs2svn-tmp/git-blob.dat', + '--dumpfile=cvs2svn-tmp/git-dump.dat', '--username=cvs2git', 'test-data/main-cvsrepos', ]) diff --git a/www/cvs2git.html b/www/cvs2git.html index 08e8aeb0..5ed7ca7c 100644 --- a/www/cvs2git.html +++ b/www/cvs2git.html @@ -344,7 +344,7 @@ cvs2git --options=OPTIONS-FILE
 mkdir myproject.git
 cd myproject.git
-git init
+git init --bare
 
@@ -359,7 +359,7 @@ git fast-import --export-marks=../cvs2svn-tmp/git-marks.dat < ../cvs2svn-tmp/ git fast-import --import-marks=../cvs2svn-tmp/git-marks.dat < ../cvs2svn-tmp/git-dump.dat -

This can, of course, be shortened to:

+

On Linux/Unix this can be shortened to:

 cat ../cvs2svn-tmp/git-blob.dat ../cvs2svn-tmp/git-dump.dat | git fast-import
@@ -367,10 +367,6 @@ cat ../cvs2svn-tmp/git-blob.dat ../cvs2svn-tmp/git-dump.dat | git fast-import
 
   
 
-  
  • If you want to get rid of unnecessary tag fixup branches, then - run the contrib/git-move-refs.py script from within the - git repository.
  • -
  • (Optional) View the results of the conversion, for example:

    @@ -381,14 +377,27 @@ gitk --all
  • +
  • (Recommended) To get rid of unnecessary tag fixup branches, run + the contrib/git-move-refs.py script from within the git + repository.
  • +
  • -

    Check out the master branch into the working copy:

    +

    The result of this procedure is a bare git repository + (one that does not have a checked-out version of the source + tree). This is the type of repository that you would put on + your server. To work on your project, make a non-bare clone + (one that includes a checked-out source tree):

    -git checkout master
    +cd $HOME
    +git clone /path/to/myproject.git
    +cd myproject
     
    +

    Now you are ready to start editing files and committing to + git!

    +
  • -- 2.11.4.GIT