🌍
English
This shows you the differences between two versions of the page.
dev:extensions:svn_to_github [2014/11/07 08:48] mistic100 created |
— (current) | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== Migrate a plugin from Piwigo.org SVN to Github ====== | ||
- | Since November 2014, the [[http://piwigo.org/ext/|plugins repository]] and the [[http://piwigo.org/translate/|translation platform]] both support Github repositories, in addition to our Subversion repository. That mean you can use the power of Github (issues, forks, pull-requests) and seamlessly integrate with piwigo.org (no more need of manual releases and/or git/svn mirrors). | ||
- | |||
- | This tutorial will guide you in the process to migrate your SVN repository to Github without loosing its history. It is inspired by [[https://www.atlassian.com/git/tutorials/migrating-overview|Atlassian tutorial]] for migrating to Bitbucket but cleaned and adapted for Github. It is adapted for plugins with only one branch (trunk), if you have branches and/or tags on your plugin and wish to migrate them, please refer to the original tutorial. | ||
- | |||
- | ===== Prerequisites ===== | ||
- | I assume you will start with a fresh OS but you certainly have some or all of the required software. (The process was tested on Windows 7 and Ubuntu 14). | ||
- | |||
- | |||
- | * Java 1.7 or 1.8 | ||
- | * Git | ||
- | * Subversion | ||
- | * Git SVN | ||
- | |||
- | === Windows === | ||
- | You can get Java JRE on [[https://www.java.com/fr/download|Oracle website]]. | ||
- | |||
- | Subversion binaries can be found on [[http://subversion.apache.org/packages.html#windows|Apache website]]. | ||
- | |||
- | Also install [[http://msysgit.github.io|mysysGit]] containing both core Git and Git SVN. | ||
- | |||
- | === Ubuntu & co. === | ||
- | You will need these packages : | ||
- | |||
- | * ''openjdk-7-jre'' (or ''openjdk-8-jre'') | ||
- | * ''subversion'' | ||
- | * ''git'' | ||
- | * ''git-svn'' | ||
- | |||
- | === Everyone === | ||
- | You will also need a little tool created by Atlassian: [[https://bitbucket.org/atlassian/svn-migration-scripts/downloads/svn-migration-scripts.jar|svn-migration-scripts.jar]]. | ||
- | |||
- | ===== Prepare ===== | ||
- | In order to get a consistent commit history on Github you will have to tell Git SVN who is who. Open a terminal where ''svn-migration-scripts.jar'' is located (Shift+Click on Windows) and enter the following command: | ||
- | |||
- | <code> | ||
- | java -jar svn-migration-scripts.jar authors http://piwigo.org/svn/extensions/YOURPLUGIN > authors_YOURPLUGIN.txt | ||
- | </code> | ||
- | |||
- | This will create a TXT file with the following syntax: | ||
- | |||
- | <code> | ||
- | j.doe = j.doe <j.doe@mycompany.com> | ||
- | m.smith = m.smith <m.smith@mycompany.com> | ||
- | </code> | ||
- | |||
- | Left part is Subversion login, right part is Github login and email. | ||
- | |||
- | === Adapt authors' file === | ||
- | Now modify the left part of each line to match an actual Github accounts. The email must be one of the emails associated to the Github account. | ||
- | |||
- | You will certainly get ''TranslationTeam'' in this file, the SVN user used to commit language files. Complete the line as following: | ||
- | |||
- | <code> | ||
- | TranslationTeam = Piwigo-TranslationTeam <translate-github@piwigo.org> | ||
- | </code> | ||
- | |||
- | Also if ''plg'' or ''mistic100'' made changes in your plugin, use theses: | ||
- | |||
- | <code> | ||
- | plg = plegall <plg@piwigo.org> | ||
- | mistic100 = mistic100 <mistic@piwigo.org> | ||
- | </code> | ||
- | |||
- | For any other users, replace ''mycompany.com'' by ''piwigo.org''. | ||
- | |||
- | And of course don't forget to specify the correct mapping for your own account! | ||
- | |||
- | ===== Convert ===== | ||
- | Open your terminal on your working directory and type: | ||
- | |||
- | <code> | ||
- | git svn clone --authors-file=authors_YOURPLUGIN.txt http://piwigo.org/svn/extensions/YOURPLUGIN | ||
- | </code> | ||
- | |||
- | This will fetch all commits on your plugin and create locally all relevant Git commits. | ||
- | |||
- | === Push === | ||
- | Now it's time to push your plugin to Github. | ||
- | |||
- | [[https://github.com/new|Create a new repository]]. You must leave it empty (no README.md, no LICENSE, no .gitignore). | ||
- | |||
- | Still in your terminal type: | ||
- | |||
- | <code> | ||
- | git remote add origin https://github.com/YOURLOGIN/YOURREPOSITORY | ||
- | git push -u origin --all | ||
- | </code> | ||
- | |||
- | Hooray ! Your plugin is now published to Github. | ||
- | |||
- | ===== Update tools ===== | ||
- | |||
- | === PEM (plugins repository) === | ||
- | Your plugin is already available in [[http://piwigo.org/ext|Extensions]], time to update the plugin data to use your new Github repo instead of the SVN one. | ||
- | |||
- | Go to [[http://piwigo.org/ext/my.php|your page]] and select the migrated plugin, then click on the SCM icon {{http://piwigo.org/ext/template/images/scm.png}}. | ||
- | |||
- | Select Git and change the URL, don't change the other fields. You must give the root URL of your repo, for example ''%%https://github.com/Piwigo/ContactForm%%'', you will be able to choose a specific branch when publishing a new revision. | ||
- | |||
- | Validate. You should see the correct Git information in the bottom block, if not, double check the form. | ||
- | |||
- | === Lexiglot (translation platform) === | ||
- | If your plugin is available in [[http://piwigo.org/translate|Piwigo Translate]] some stuff has to be done to continue the translation on Github. | ||
- | |||
- | == Authorize user == | ||
- | |||
- | As on SVN we use a single user to push translations to all plugins, this user is [[https://github.com/Piwigo-TranslationTeam|Piwigo-TranslationTeam]]. You must give push access to the user on your repo. | ||
- | |||
- | To do so, on your repository page, go to **Settings / Collaborators** and add **Piwigo-TranslationTeam**. | ||
- | |||
- | == Notify us == | ||
- | |||
- | We need to reconfigure Lexiglot to use your new repository. Contact one of the team members on the forum or send an email to **translate-github [at] piwigo [dot] org** to tell us what is the new location of your plugin. | ||
- | |||
- | By default all commits are pushed to the master branch, you can tell us if you want translations to be pushed to any other branch (the branch must already exists). | ||
- | |||
- | We decided to not use pull-requests because it's a bit more complicated to implement and we don't want to spam you with a bunch of PR every week (the translation team is very active !). |