This is the mail archive of the
kawa@sourceware.org
mailing list for the Kawa project.
Re: Fwd: Switching from Subversion to Git
- From: Matthieu Vachon <matthieu dot o dot vachon at gmail dot com>
- To: Per Bothner <per at bothner dot com>, "kawa at sourceware dot org" <kawa at sourceware dot org>
- Date: Tue, 15 Sep 2015 12:54:43 -0400
- Subject: Re: Fwd: Switching from Subversion to Git
- Authentication-results: sourceware.org; auth=none
- References: <CABgWrqq6gssqdibvEtXUp_=1uK9z0eMNYp5bwJEa4=_BPVKeQw at mail dot gmail dot com> <53FF9110 dot 7090001 at bothner dot com> <CABgWrqrU55+UXVyQyUrQh23yPoOPdU6ZYqnRHy6MbNo1WtFJyA at mail dot gmail dot com> <6F8AB4FD-12CA-40B1-A0C0-8221D094EAE2 at me dot com> <CAOTvmokUE3SkhLxxo0arsfYMb44P_FrnB1qwZ0J8xYVLjmRS=Q at mail dot gmail dot com> <5420917F dot 2090107 at bothner dot com> <CAOTvmono8r6tMZ2AmZy5Hwi0G-Jiejf0eGw=kmoyLowCwv0DdQ at mail dot gmail dot com> <20140924023952 dot 3bf0883c at capac> <CAOTvmomvuAB_Th3DAP2K4sLbosA_V1o8hX-FSVS1n7NEnLFGSw at mail dot gmail dot com> <54246272 dot 3080804 at bothner dot com> <m2wq8qevbj dot fsf at gmail dot com> <CAOTvmomrj4w=T4QXFhtMb_moJK3DHR9Y-Q1qU1qvNRs55SjV4g at mail dot gmail dot com> <542F9B5D dot 7010200 at bothner dot com> <55DB69D8 dot 2080508 at bothner dot com> <CAOTvmo=TXBAmcU4XtD1yz1U7mQ7sUO0qgXSu-18RMyyjRYQ+Rg at mail dot gmail dot com> <55DE7ADA dot 5020601 at bothner dot com>
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/