On 23 December 2012 20:05, William S Fulton <wsf@fultondesigns.co.uk> wrote:
On 22/12/12 00:02, William S Fulton wrote:
On 21/12/12 09:53, Klaus Kaempf wrote:
> * William S Fulton <wsf@fultondesigns.co.uk> [Dec 20. 2012 22:14]:
> >
> > I have managed to use the https://github.com/nirvdrum/svn2git tool with
> > the --metadata option that Vadim kindly pointed out. The results look
> > good.
>
> Great ! Put it up on github for peer-review !
>
> The actual svn->git conversion could also be crowd-sourced. Just
> publish the final 'authors' file and let people experiment and discuss
> on swig-devel.
>
> > But the idea of having the svn revision numbers as git notes is
> > quite nice if it can be done easily. I'm not sure I fully understand
> the
> > implications when repos are cloned or branched/merged though
>
> Let's try it out. Push your current git repo to github, clearly mark
> it as temporary, and let developers work on it.
>
> >
> > The kde based svn2git looks somewhat more complicated to use and it
> > requires qt4 and kde which I don't have, although I'm sure with a
> bit of
> > effort I could install a new distribution to get the dependencies.
>
> With the authors file, anyone can run it, put the result on github and
> let you clone the repo and push it to the final place. This liberation
> of ownership is _the_ groundbreaking feature of git.
I'm splitting the svn repo into two. One is the www directory containing
the website and the other will be the source code. I have pushed the www
repo into github: https://github.com/swig/www first. Anyone with some
git experience, please take a look and offer any comments on the
conversion as I'll do the same for the source tomorrow. The steps I took
were:

   svn2git https://swig.svn.sourceforge.net/svnroot/swig/www --metadata
--rootistrunk --authors swig.authors

where swig.authors is at https://gist.github.com/4322950 ... This file
comes from Vadim and I edited it taking most of the email addresses from
postings on the swig-devel or old swig-dev mailing lists.

Next I used git rebase -i to replace empty log messages with "Empty log
message".
Then I deleted a strange empty branch which occurred at the time of the
cvs2svn conversion:

git branch -d "trunk@9588"
   git branch -r -d svn/trunk@9588

Created the new repo on github and pushed it after a git-gc:

   git gc --aggressive
   git remote add origin https://github.com/swig/www.git
   git push -u origin master

I've uploaded the source into a git repo at https://github.com/swig/source-temporary. The repo needs fixing, so please don't use it unless you can help check it over and fix it up.

There is a problem which I haven't had time to research to fix and would appreciate some help. I tried to use git rebase -i to replace the empty log messages, but any kind of rebase breaks, such as:


$ git log --oneline | grep git-svn-id
a162d6e git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@10361 626c5289-ae23-0410-ae9c-e8d60b6d4f22
33582bd git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@10275 626c5289-ae23-0410-ae9c-e8d60b6d4f22
b2c7e22 git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@10025 626c5289-ae23-0410-ae9c-e8d60b6d4f22
7060aa9 git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@10023 626c5289-ae23-0410-ae9c-e8d60b6d4f22
5bdee3f git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@10017 626c5289-ae23-0410-ae9c-e8d60b6d4f22
d2fcf38 git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@9888 626c5289-ae23-0410-ae9c-e8d60b6d4f22
3d2116e git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@9758 626c5289-ae23-0410-ae9c-e8d60b6d4f22
9a9dc06 git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@9666 626c5289-ae23-0410-ae9c-e8d60b6d4f22
d7a9b8f git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@9601 626c5289-ae23-0410-ae9c-e8d60b6d4f22
4c0a1bc git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@9600 626c5289-ae23-0410-ae9c-e8d60b6d4f22
$ git rebase -i 4c0a1bc~1
The previous cherry-pick is now empty, possibly due to conflict resolution.
If you wish to commit it anyway, use:

    git commit --allow-empty

Otherwise, please use 'git reset'
# Not currently on any branch.
nothing to commit (working directory clean)
Could not apply f4e5cd4... Branch for development of -builtin option for python.


$ git show f4e5cd4
commit f4e5cd4f882d5001acc93d029cd141bf07c390e3
Author: Stefan Zager <szager@gmail.com>
Date:   Tue Dec 7 20:32:19 2010 +0000

    Branch for development of -builtin option for python.

    With this option, swig will produce new built-in python
    types for all wrapped classes.  Built-in types offer a
    substantial performance benefit compared to the current
    shadow class implementation.



    git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/branches/szager-python-builtin@12326 626c5289-ae23-04


I would like rebase to just work going forwards. The problem seems to have arisen from creating the svn branch, deleting it then creating it again with the same name.

I've pushed another repo at https://github.com/swig/source-temporary2. This one includes all the tags and branches which I omitted last time. It also removes all the empty commits which were the cause of the problem above. There were quite a few empty commits due to svn property changes. I removed them using info from http://stackoverflow.com/questions/7067015/svn2git-with-exclude-any-way-to-ignore-the-empty-blank-commits,:

  $ git filter-branch --tag-name-filter cat --prune-empty -- --all

then from http://www.kernel.org/pub/software/scm/git/docs/git-filter-branch.html for shrinking the resulting repository.

  $ git for-each-ref --format="%(refname)" refs/original/ | xargs -n 1 git update-ref -d
  $ git gc --prune=now

There were some unreachable objects and I should have run
  $ git reflog expire --expire=now --all
before the 'git gc' and git push to github but it doesn't seem to matter - the number of objects reported by 'git fsck' is the same after running the above line and what I got back from a github clone:

However, I've given up trying to modify the old empty commit messages using 'git rebase -i' to rename empty commits. The interactive rebase is rather disappointing as it ends up having to re-resolve merge conflicts. I guess we shouldn't be rebasing the subversion commits in the future so this is not a big deal.

I've used 'git fsck' with all the various options and it checks okay. However, 'git fsck --root' reports 4 root nodes, but am not sure if this is okay yet. Advice welcome... git is a whole order more complex than subversion and somewhat more frustrating to get to grips with.

Some folk need to sync/rebase their current git repos to this one. I'd really like this to be tried out soon to make sure it is all okay before officially pushing it as the new repo. Klaus, Vadim,  Oliver?? Are there any other sanity checks to try out? I want to merge the c++11 support in gsoc2009-matevz into the master soon, so may try that out.

William