6,566
edits
(→Development scenarios: Created a new skeleton subsection titled "Team development (git-svn)".) |
(→Team development (git-svn): Filled out the section, and renamed it.) |
||
Line 313: | Line 313: | ||
If you keep your local master separate from FGAddon you would need to cherry-pick upstream updates you want to your master branch. These days I always use git-svn rather than the ordinary SVN tools when working with SVN repositories. It is just so much nicer to me. | If you keep your local master separate from FGAddon you would need to cherry-pick upstream updates you want to your master branch. These days I always use git-svn rather than the ordinary SVN tools when working with SVN repositories. It is just so much nicer to me. | ||
=== | === Private team development (git-svn) === | ||
{{Note|Development scenario: One team leader is acting as the gatekeeper on a private git repository, using git-svn to push a fgaddon branch to FGAddon, with team members committing directly to the private repository or making merge requests from their fork of the private repository.}} | {{Note|Development scenario: One team leader is acting as the gatekeeper on a private git repository, using git-svn to push a fgaddon branch to FGAddon, with team members committing directly to the private repository or making merge requests from their fork of the private repository.}} | ||
To keep everything in-house, the entire operation will be based on the official infrastructure and remote repositories under each user's SourceForge (SF) profile. Note to the team leader - you must [https://git-scm.com/book/en/v1/Git-and-Other-Systems-Git-and-Subversion#git-svn keep your git-svn history linear]. | |||
In the following, the "ornithopter" aircraft will be used as an example. | |||
==== The team ==== | |||
Firstly, the entire team should sign up for [[#SourceForge account|SourceForge accounts]]. | |||
==== Team leader ==== | |||
===== Private repository set up ===== | |||
These steps are to be taken by the team leader. In your SourceForge user profile, set up a pure git repository: | |||
* Go to "Personal tools" -> "Add Tools". | |||
* "Click to install" -> "git". | |||
* Set label to "FGAddon git-svn ornithopter". | |||
* Set the code path to "ornithopter". | |||
Then create a local git repository: | |||
<syntaxhighlight lang="bash"> | |||
$ mkdir ornithopter | |||
$ cd ornithopter | |||
$ git init | |||
</syntaxhighlight> | |||
Set up a special git-svn branch for FGAddon gatekeeping and dcommitting (pushing): | |||
<syntaxhighlight lang="bash"> | |||
$ git svn init svn+ssh://<username>@svn.code.sf.net/p/flightgear/fgaddon/trunk/Aircraft/ornithopter | |||
$ git svn fetch | |||
$ git branch fgaddon remotes/git-svn | |||
$ git checkout fgaddon | |||
$ git svn rebase | |||
$ git branch -vva | |||
$ git remote -v | |||
$ git svn info | |||
$ git checkout master | |||
</syntaxhighlight> | |||
Replace <username> with your SF user name. Finally, set up the git repository as a remote and push: | |||
<syntaxhighlight lang="bash"> | |||
$ git remote add origin ssh://<username>@git.code.sf.net/u/<username>/ornithopter | |||
$ git push -u origin master | |||
$ git branch -vva | |||
$ git remote -v | |||
</syntaxhighlight> | |||
The repository will be located at ''<nowiki>https://sourceforge.net/u/<username>/ornithopter/ci/master/tree/</nowiki>''. | |||
===== Team setup ===== | |||
Again this is for the team leader to perform. Firstly create a new development team, under your user profile: | |||
* Go to "Personal tools" -> "Admin". | |||
* Click on "User Permissions". | |||
* Click on "Add a new group" at the bottom. | |||
* Set the name to "ornithopter", and save. | |||
* Click on "Add" in the "ornithopter" group and add your team members. | |||
Then set up the your development group with your team mates: | |||
* Go to the "FGAddon git-svn ornithopter" git repository. | |||
* Click on "Admin - FGAddon git-svn ornithopter", then select "Permissions". | |||
* In the "Write" section, remove "Developer" and add "ornithopter". | |||
* Click on "Save". | |||
===== Pushing to FGAddon ===== | |||
Committing to FGAddon is for the local git repository of the team leader. History must be linear in the fgaddon branch, so cherry-picking is the way to go. This is from [[#Individual developer (git-svn)]]. In the git repository, type: | |||
<syntaxhighlight lang="bash"> | |||
$ git checkout fgaddon | |||
$ git svn rebase | |||
$ git cherry-pick <commit id> | |||
$ git svn dcommit | |||
$ git checkout master | |||
</syntaxhighlight> | |||
==== Team members ==== | |||
===== Working with the repository ===== | |||
Each team member should make a clone of the private git repository: | |||
<syntaxhighlight lang="bash"> | |||
$ git clone ssh://<username>@git.code.sf.net/u/edauvergne/ornithopter ornithopter | |||
</syntaxhighlight> | |||
Replace "<username>" with your SourceForge user name. | |||
===== Forking and merge requests ===== | |||
Alternatively, each team member can fork the git repository under your SourceForge account: | |||
* Go to https://sourceforge.net/u/edauvergne/ornithopter/ci/master/tree/. | |||
* Click on "Fork". | |||
* Set the mount point to "ornithopter" and change the label as you wish. | |||
Develop and push to your fork, then make merge requests by clicking on the "Request Merge" button. | |||
[[Category:FlightGear]] | [[Category:FlightGear]] |