[developers] First step for the clone of FFTB SVN in GitHub

goodman.m.w at gmail.com goodman.m.w at gmail.com
Wed Jul 22 15:51:42 CEST 2020


Hi Alexandre,

On Wed, Jul 22, 2020 at 12:10 AM Alexandre Rademaker <arademaker at gmail.com>
wrote:

> mkdir treebank
> cd treebank
> git svn init http://sweaglesw.org/svn/treebank --stdlayout --prefix=svn/
> for tag in `git branch -r | grep "tags/" | sed 's/ tags\///'`; do git
> branch $tag refs/remotes/$tag; done
> git svn fetch
>

This looks more or less right, but you didn't link the SVN author(s) to
GitHub accounts using --authors-file. Also I think it makes more sense to
create Git tags for the SVN tags instead of branches.

I also tried importing this repo using GitHub's importer (
https://docs.github.com/en/github/importing-your-projects-to-github/about-github-importer)
and it worked great. It's very simple and results in a Git-like repository,
but unfortunately it does not keep the SVN tracking information needed for
proper mirroring. It would work better for a one-time import.

So I suggest recreating your repo as follows. First create the authors file:

    cat > authors.txt <<EOF
    sweaglesw = sweaglesw <sweaglesw at users.noreply.github.com>
    (no author) = (no author) <(no author)>
    EOF

Then clone (does init and fetch in one command):

    git svn clone http://sweaglesw.org/svn/treebank --stdlayout
--prefix=svn/ --authors-file=authors.txt

Then convert remote tag-branches to Git tags:

    cd treebank
    git for-each-ref --format="%(refname:lstrip=-1) %(objectname)"
refs/remotes/svn/tags |
    while read ref; do
      git tag $ref;
    done

And replace the 'master' branch with 'trunk':

    git checkout -b trunk
    git branch -d master



> The SVN repository (http://sweaglesw.org/svn/treebank/) didn’t contain
> branches, so I have created branches for the two tags I found: `foo` and
> `packard-2015`. Note that these tags do not look very interesting and maybe
> they could be removed in the SVN repository. That would make the process
> even simpler, tracking only the trunk branch.
>

You're probably right about 'foo', but the 'packard-2015' tag points to the
revision used for Woodley's thesis and IWCS 2015 paper so I don't think we
should discard that one. But maybe it doesn't matter for a mirror since it
still exists in the SVN repo?


We don’t have automation yet, if Woodley update its SVN, all I need to do
> is:
>
> git svn fetch
> git push --all -u origin
>

When you do `git svn fetch`, it retrieves the commits from the remote SVN
repository but doesn't incorporate them into your local tree. Use `git svn
rebase` instead.



>
> Hi Michael and Stephan, any comments about the solution above? Michael is
> the only user in the https://github.com/delph-in organization? Can you
> add me so I can move this repository to the delph-in org?
>

Francis invited you to be a member of the organization. I just updated that
invitation so you'd be added to the "Sweagles" team, which has admin rights
to the delph-in/FFTB repository I created. Once you accept the invitation,
you can do the following to push your repo:

    git remote add origin https://github.com/delph-in/FFTB.git
    git push -u origin --all
    git push -u origin --tags

(I called the remote repo FFTB instead of treebank because it's more
distinctive and recognizable, I think.)

-- 
-Michael Wayne Goodman
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.delph-in.net/archives/developers/attachments/20200722/5d24c791/attachment.html>


More information about the developers mailing list