Hi fellow wiki editors!

To help newly registered users get more familiar with the wiki (and maybe older users too) there is now a {{Welcome to the wiki}} template. Have a look at it and feel free to add it to new users discussion pages (and perhaps your own).

I have tried to keep the template short, but meaningful. /Johan G

FlightGear Git: aircraft authors

From FlightGear wiki
Jump to: navigation, search
This article has been nominated for deletion since 27 February 2016. To discuss it, please visit the talk page.

Do not remove this tag until the discussion is closed.

Reason for the nomination: This article is no longer relevant for aircraft development and has been superseded by FGAddon

This is a draft.

Do not use this!! Instead use the method described at Merge request.

Each aircraft is developed in its own repository on Gitorious, listed under the [https://gitorious.org/flightgear-aircraft FlightGear Aircraft project].

The following examples are based on the c172p. Exact commands will be slightly different for other aircraft!

Start a new aircraft

You can request an aircraft repository by contacting the [https://gitorious.org/+flightgear-aircraft FlightGear Aircraft admins]. You can do so via the devel-mailing list. Make sure to [https://gitorious.org/users/new register an account] at Gitorious beforehand, else you cannot be granted acces to the repository! Include your account name (in the form of ~name) and the aircraft you'd like to start.

As an author, you will get commit and review rights for your aircraft's repository. This means that you can push commits and process merge requests.

Set up a development environment

Create an empty directory on your computer for your aircraft (eg. FlightGear/Aircraft), from now on we will call this $FG_AIRCRAFT. First go into this directory then clone your aircraft's repository from Gitorious.

git clone git@gitorious.org:flightgear-aircraft/c172p.git c172p

This will put all files related to the c172p in $FG_AIRCRAFT/c172p. You can repeat the clone step if you have more than one aircraft.

In order to run these aircraft in FlightGear, it's important to set the $FG_AIRCRAFT variable to your newly created directory.

Update your own aircraft

cd $FG_AIRCRAFT/c172p
git status -- .

You will now see a list of files that are changed on your local repository. For each single edited/added file that you'd like to commit, run git add; to add all changed files to your commit, you add -a. For files that should be deleted, you use git rm:

git add c172p-set.xml         # add one file
git add -a                    # add all changed files
git rm c172p-set-copy.xml     # remove one file

Run git status again, to check that you didn't miss any files, or made other mistakes. All files that are listed under "Changes to be commited" will be included in your commit.

git status -- .

When all is fine, we can create the actual commit.

git commit -m "A short description/summary of my commit."

or, if you'd like to add a multi-line commit message:

git commit

To make sure that everything went well, we do a dry-run first. By doing so, it will look as if the commit is pushed to Gitorious, but it won't leave your computer (yet). We run gitk to get a visual indication of the commit.

git push git@gitorious.org:flightgear-aircraft/c172p.git master --dry-run

Now it's time to finally push the commit(s) to Gitorious. After this step your edits will be visible to the whole world, so make sure everything is fine before you continue! It is possible to revert commits when something goes wrong, but you don't want to go through all the trouble.

git push git@gitorious.org:flightgear-aircraft/c172p.git master

Update someone else's aircraft

If you made some improvements to someone else's aircraft that you'd like to share you can create a merge request in its repository. It's up to the aircraft author to accept your edits.

Click the "Clone repository" button on the aircraft's repository page. You will now follow the same steps as under update your own aircraft, except that your repository url is different.

When you're finished pushing, go back to your cloned repository and click the "Request merge" button. You can write a short summary of your merge request (mainly: what does it) and select what commits you'd like to include. You'll now have to wait for the aircraft author to accept your merge request.

Process merge requests

Make sure your local clone of the aircraft is up to date.

 git checkout -b integration
 git fetch git://gitorious.org/flightgear-aircraft/c172p.git refs/merge-requests/1
 git checkout master
 git merge integration
 git push git@gitorious.org:flightgear-aircraft/c172p.git master --dry-run
 git push git@gitorious.org:flightgear-aircraft/c172p.git master