Menu

#17 switch from svn to git

fixed
git (1) svn (1)
5
2016-04-11
2016-02-29
Paul Wise
No

I would like to switch the icns repo from SVN to git. I'd prefer to keep SF for continuity. Since SF was recently sold to people who have a clue it is a lot more trustworthy now.

Since we have no branches it should be a simple matter of saving an authors file and script, enabling git, running the script, pushing to git and deleting the SVN repository. If we wanted to get fancy we could rewrite the author on commits where we just applied someone else's patches, but that seems like a lot of work.

Some advantages of git:

Possibility to have tags/branches, current SVN repo can only have trunk.

Tags and commits can be signed with OpenPGP keys for security.

Commits are more secure anyway due to the hash chain.

authors.txt:

pabs3 = Paul Wise <pabs3@bonedaddy.net>
KingRobot = Mathew Eis <mathew@eisbox.net>
kingrobot = Mathew Eis <mathew@eisbox.net>
matheweis = Mathew Eis <mathew@eisbox.net>

svn2git:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
#!/bin/sh
set -ex
rm -rf git
rsync --archive --verbose --progress --compress --hard-links --delete --copy-unsafe-links svn.code.sf.net::p/icns/code/ `pwd`/svn/
git svn clone --no-metadata --authors-file=authors.txt file://`pwd`/svn/ git
cd git
git branch -d -r git-svn
git config --remove-section svn-remote.svn
git config --remove-section svn
rm -rf .git/svn
git gc --aggressive --prune=now
git remote add origin ssh://git.code.sf.net/p/icns/code
git config branch.master.remote origin
git config branch.master.merge refs/heads/master

Discussion

  • Paul Wise

    Paul Wise - 2016-02-29
    • Description has changed:

    Diff:

    --- old
    +++ new
    @@ -12,24 +12,24 @@
    
     authors.txt:
    
    -  pabs3 = Paul Wise <pabs3@bonedaddy.net>
    -  KingRobot = Mathew Eis <mathew@eisbox.net>
    -  kingrobot = Mathew Eis <mathew@eisbox.net>
    -  matheweis = Mathew Eis <mathew@eisbox.net>
    +    pabs3 = Paul Wise <pabs3@bonedaddy.net>
    +    KingRobot = Mathew Eis <mathew@eisbox.net>
    +    kingrobot = Mathew Eis <mathew@eisbox.net>
    +    matheweis = Mathew Eis <mathew@eisbox.net>
    
     svn2git:
    
    -  #!/bin/sh
    -  set -ex
    -  rm -rf git
    -  rsync --archive --verbose --progress --compress --hard-links --delete --copy-unsafe-links svn.code.sf.net::p/icns/code/ `pwd`/svn/
    -  git svn clone --no-metadata --authors-file=authors.txt file://`pwd`/svn/ git
    -  cd git
    -  git branch -d -r git-svn
    -  git config --remove-section svn-remote.svn
    -  git config --remove-section svn
    -  rm -rf .git/svn
    -  git gc --aggressive --prune=now
    -  git remote add origin ssh://git.code.sf.net/p/icns/code
    -  git config branch.master.remote origin
    -  git config branch.master.merge refs/heads/master
    +    #!/bin/sh
    +    set -ex
    +    rm -rf git
    +    rsync --archive --verbose --progress --compress --hard-links --delete --copy-unsafe-links svn.code.sf.net::p/icns/code/ `pwd`/svn/
    +    git svn clone --no-metadata --authors-file=authors.txt file://`pwd`/svn/ git
    +    cd git
    +    git branch -d -r git-svn
    +    git config --remove-section svn-remote.svn
    +    git config --remove-section svn
    +    rm -rf .git/svn
    +    git gc --aggressive --prune=now
    +    git remote add origin ssh://git.code.sf.net/p/icns/code
    +    git config branch.master.remote origin
    +    git config branch.master.merge refs/heads/master
    
     
  • Paul Wise

    Paul Wise - 2016-03-15

    Any comments on this Mathew? I would like to do this before the next release, which needs to be soon so I can upload it to Debian for the Jasper removal.

     
  • Paul Wise

    Paul Wise - 2016-04-11

    Since there has been no response in ages, I will do this myself now.

     
  • Paul Wise

    Paul Wise - 2016-04-11
    • labels: git --> git, svn
    • status: open --> closed-fixed
    • assigned_to: Paul Wise
     
  • Paul Wise

    Paul Wise - 2016-04-11

    I've done the conversion, stashed a copy of the SVN repo in a tarball and removed the svn repository so people know that it has been replaced by git. If you login to the sourceforge shell server, the tarball is available here:

    /home/project-web/icns/svn.tar.gz

     
  • Paul Wise

    Paul Wise - 2016-04-11
    • status: closed-fixed --> fixed
     

Log in to post a comment.