This is the mail archive of the kawa@sourceware.org mailing list for the Kawa project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Fwd: Switching from Subversion to Git


Hi Per,

Here the steps I propose for this issue:

 1. Take necessary actions with Savannah to create git repository
where you get write access to it. I will assume url of connection to
be `bothner@git.sv.gnu.org:/srv/git/kawa.git`.

 2. At this point, you have two choices to retrieve svn to git clone.
You either use my uploaded already built svn to git clone or create a
new one from scratch. Indeed, svn metadata is stored on the local
computer and cannot (to my knowledge), be shared easily. Only way I
know is to zip whole git repository and share it or clone it back from
scratch.

      1. If you download my own already built and zip repository, do
the following:

              cd ~/downloads
              # Download zip file from  to kawa-git.zip

              cd ~/work/
              unzip ~/downloads/kawa-git.zip
              # Zip contains a single directory named kawa-git

      2. If you choose to do yourself a new svn to git clone (doing
directly `git svn clone -s svn://sourceware.org/svn/kawa kawa-git`
never work for me hence the local svn mirror in kawa-svn):

              cd ~/work
              svnadmin create kawa-svn
              printf '#!/bin/sh\nexit 0;\n' > kawa-svn/hooks/pre-revprop-change
              svnsync init file:///home/bother/work/kawa-svn
svn://sourceware.org/svn/kawa # Use correct absolute path to svn
mirror file:///....
              svnsync sync file:///home/bother/work/kawa-svn # Use
correct absolute path to svn mirror file:///....
              # Around 45 minutes

             git svn clone -s -r 1:8526
file:///home/bother/work/kawa-svn kawa-git # Use correct absolute path
to svn mirror file:///....
             # Around 180 minutes

 3. Then you add Savannah as a new remote in your git repository

              cd ~/work/kawa-git
              git remote add upstream bothner@git.sv.gnu.org:/srv/git/kawa.git

 4. Push the git branches you need:

              git push upstream master
              git checkout -b invoke origin/invoke
              git push upstream invoke
              git checkout -b callcc origin/callcc
              git push upstream callcc

 5. Work with git now instead of SVN by making some commits and then
sync back to svn (theory from here as I did not test those commands):

               # Make some git commits in master branch
               git svn dcommit
               git push upstream master

The sync back command (i.e. `git svn dcommit`) rewrites git sha1
commit to add SVN revision number. That's why you must first commit
back to SVN and then pushing to git remote. Pushing to git first and
then doing `git svn dcommit` would require next push to be a force
push (git push origin -f master) since parts of the history was
rewritten by `git svn dcommit`.

You could also make some SVN commits and then update your local git
svn clone with `git svn fetch` (or `git svn rebase` if you had git
commits not synced back to SVN). Moreover, different branch (invoke
and callcc) should work. You should also be able to work in them in
git and push back commits to svn respective branches. I'm not sure
about merging however. Merging might be better done in SVN and then
sync back to git afterward.

All this information (and much more) is all described at
https://git-scm.com/book/en/v1/Git-and-Other-Systems-Git-and-Subversion.
It's a pretty good reference page.

Automatic mirror is probably not needed here since you are the only
one with write access. You can simply work only in git, and push back
commits to SVN to keep them in sync. Don't hesitate to ask anything if
steps are unclear.

Regards,
Matt

On Wed, Aug 26, 2015 at 10:50 PM Per Bothner <per@bothner.com> wrote:
>
>
>
> On 08/26/2015 04:35 PM, Matthieu Vachon wrote:
> > Note: Re-posting on mailing-list with plain text, sorry.
> >
> > Hi Per,
> >
> > Sure I still volunteer to make it happen. As said earlier, I already
> > performed SVN conversion to git and it's hosted at
> > https://github.com/maoueh/kawa-fork. Could you take a look and ensure
> > that is correct with you. It would then be a simple matter of pushing
> > the SVN mirror to the new Savannah git repository.
>
> It looks ok.  It would look different on Savannah.
> http://git.savannah.gnu.org/cgit/emacs.git
>
> Note that since your git clone I've created two branches
> (invoke, plus callcc, which is branched off invoke).
> That might change things.
>
> > It is not fully up-to-date as I had problem syncing with SVN. It
> > stopped with some weird errors on revision 8527. So, current `master`
> > branch (equivalent to `trunk`) is at revision 8526. Will try to debug
> > syncing problem when I find more time.
> >
> > Is a manual SVN mirror enough or are you aiming more to an fully
> > automatic mirror? Do you want a bi-directional mirror (git push syncs
> > to SVN and SVN commit pushes to git) or a one way would be ok (SVN to
> > git only)?
>
> It depends on the goal.  If the goal is to switch over to git as the
> primary repository, then the mirroring doesn't have to be full.
> In fact we don't *need* automatic mirroring at all - its just nice.
>
> At the very list we need to git repository on Savannah.  It doesn't
> have to be a mirror of the svn repository, though that would be nice.
> It's acceptable for it to just be a static snapshot, or one that can
> be manually brought up to date - only needed during the evaluation period.
>
> If after the evaluation period we decide to make the switch, then we
> freeze the old repository (easy as long as I'm the only committer).
> Then we do a final update from the old repository, and then after
> some testing we declare the new repository as the primary one.
>
> Of course if bi-directional mirroring is easy to set up, I won't
> say no :-)
> --
>         --Per Bothner
> per@bothner.com   http://per.bothner.com/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]