From Mageia wiki
Jump to: navigation, search

Git Usage Guide for l10n and Documentation Teams

SSH keys

Please refer to this page for the detail instructions on how to create, upload and use your SSH key to access Mageia's repositories.


Warning.png
Warning!
Before using git to commit&push your changes you should wait for your key to be added into Mageia database (it turns out that you can wait for a relatively long time).


Getting git commit&push rights

As a rule, each language should have two people who are able to commit&push changes, but there are some exceptions:

  • language teams with only one person obviously don't have two people who can commit&push changes
  • Some team members are also doing something else towards Mageia development and may have git access already
  • Some really big teams might need additional people

If you are just joining Mageia l10n or doc team and your language does not have anybody who can commit&push at that time, it may still take some time for you to get write access to the git. After all, we don't know who you are and it is a trusted position.

If you are new to the Mageia community, you can still begin working by checking out the files anonymously and sending them to the appropriate mailing list for someone else to commit&push them.

This does not mean we mistrust you personally, it's just a precaution.

Git Pre-Configuration

Git packages

Install git and gitk packages and all dependencies.

.gitconfig file

Open your favourite text editor window. Enter the following lines (please replace your name and the credentials as appropriate):

[user]
     name = Your Name
     email = your_email@example.com
[color]
     ui = true
[url "git://git.mageia.org/"]
     insteadof = mga:
[url "ssh://git@git.mageia.org/"]
     pushInsteadof = mga:
[alias]
     ci = commit
     up = pull --rebase
[push]
     default = matching

Save the results as .gitconfig file in your home folder (~).

Using Git

Cloning the repo

Choose the repo of interest from this page.

Open the terminal in the folder of your repos (e.g. navigate to this folder in Dolphin and press F4). Enter the following command:

Konsole.png
[user@computer ~]$ git clone mga:name_of_the_repo
[user@computer ~]$ _


Example:

Konsole.png
[user@computer ~]$ git clone mga:software/i18n/tools
[user@computer ~]$ _


When the cloning is complete you can apply any changes you like, adding files, editing them, deleting them.

Updating your repo

Open the terminal in the folder of your cloned repo (e.g. navigate to this folder in Dolphin and press F4). Enter the following command:

Konsole.png
[user@computer ~]$ git up
[user@computer ~]$ _


Adding files to your repo

Open the terminal in the folder of your cloned repo (e.g. navigate to this folder in Dolphin and press F4). Enter the following command to add a file "filename.ext" to your repo:

Konsole.png
[user@computer ~]$ git add filename.ext
[user@computer ~]$ _


You can use patterns like *. Example:

Konsole.png
[user@computer ~]$ git add *.xml
[user@computer ~]$ _


Checking out what is changed

Open the terminal in the folder of your cloned repo (e.g. navigate to this folder in Dolphin and press F4). Enter the following command to obtain the list of changed or not committed objects in your local copy:

Konsole.png
[user@computer ~]$ git status
[user@computer ~]$ _


or simply

Konsole.png
[user@computer ~]$ gitk
[user@computer ~]$ _


Committing to your repo

Open the terminal in the folder of your cloned repo (e.g. navigate to this folder in Dolphin and press F4). Enter the following command:

Konsole.png
[user@computer ~]$ git ci -m "Your commit message" -a
[user@computer ~]$ _


Pushing the committed changes to the Mageia repo

Open the terminal in the folder of your cloned repo (e.g. navigate to this folder in Dolphin and press F4). Enter the following command:

Konsole.png
[user@computer ~]$ git push
[user@computer ~]$ _


Warning.png
Warning!
Do not forget to update your repo first (see subtitle Updating your repo) to avoid conflicts.


Convenience

Using git GUI

Should you want to do above operations from GUI you can open the terminal in the folder of your cloned repo (e.g. navigate to this folder in Dolphin and press F4) and enter the following command:

Konsole.png
[user@computer ~]$ git gui
[user@computer ~]$ _


Below is a short tutorial on how to use it.

Standard Git GUI (click to enlarge)
Staging

Staging is the marking files ready for the commit command.

  • Pressing button the in the lower center, called Rescan or F5 on your keyboard will check your repository for modifications.
  • In the top left box called Unstaged Changes you will see all the files you have modified in the repository. Use Ctrl or Shift + mouse click to select multiple files in there.
  • Ctrl+T will mark the selected set as staged and will put them in into the lower left box, called Staged Changes (Will Commit).
  • Now the staged files should be in the lower left corner. If you want to unstage files, use Commit → Unstage From Commit from the menu bar or press Ctrl+U.
Commiting

You can now commit the staged files to your local repository. You can always add a change to your local repository first. This is useful when not having an Internet connection or to create logic atomic commits as often as possible.

In the lower right box, called Commit Message (red frame + 1 on the screenshot above), you have to define the commit comment.

Documentation: Add some docs on drak utils

The keyboard shortcut to commit is Ctrl+Enter or you can press the Commit button (yellow frame + 2 on the screenshot above).

Pushing

Once you want to upload all your commits to the Mageia server, you push it. Press the Push button (green frame + 3 on the screenshot above) or just use Ctrl+P shortcut.


Reverting Uncommitted Changes

At times you have modified a (set of) files on your computer and you want to discard those changes.

  • Launch Git GUI.
  • If your file is already staged, unstage it.
  • Select the (set of) file(s) in the Unstaged Changes list.
  • Use Commit → Revert Changes item from the main menu or Ctrl+J shortcut.
Renaming files or folders

You can rename the file(s) or folder(s) with your file manager and git will be able to link the removal with the addition automatically and maintain the history. Just do not forget to commit and push the changes.

Documentation resources for translation in our git

Name git clone address pot file location (html:/) pot file location (svn:/)
MCC help git clone mga:software/i18n/tools docs/mcc-help
Installer help git clone mga:software/i18n/tools docs/installer
mageia-doc it doesn't exist yet on git, the already translated html files come from Calenco mageia-doc in svn mageia-doc in svn

Do not be afraid of the catalog size. Every translation you will make can be converted into the resulting XML. Nothing will be lost but all untranslated messages just remain in English.

To convert your translation for uploading into Calenco just enter the following command:

Konsole.png
[user@computer ~]$ ./makedoc.sh <your_locale>
[user@computer ~]$ _


in the mcc-help directory. Example:

Konsole.png
[user@computer ~]$ ./makedoc.sh uk
[user@computer ~]$ _


A short tutorial on this is here (no need to create the files, they are already in place):

You can also see some notes on how to use Lokalize for translations.

Software resources for translation in our git

Notepad.png
Please note!
This list is here temporary. It will probably appear on its own page. Old page (Svn for translators is obsolete.


Resources for Cauldron and the next released version of Mageia

Name pot file location git clone address
control-center plain browse git clone mga:software/control-center
desktop-common-data plain browse git clone mga:software/desktop/common-data
drak3d plain browse git clone mga:software/drak3d
drakguard plain browse git clone mga:software/drakguard
draklive-install plain browse git clone mga:software/draklive-install
drakmenustyle plain browse git clone mga:software/drakmenustyle
drakpxelinux plain browse git clone mga:software/drakpxelinux
drakwizard plain browse git clone mga:software/drakwizard
drakx-kbd-mouse-x11 plain browse git clone mga:software/drakx-kbd-mouse-x11
drakx-net plain browse git clone mga:software/drakx-net
drakx_install plain browse git clone mga:software/drakx
drakx_share plain browse git clone mga:software/drakx
drakx_standalone plain browse git clone mga:software/drakx
epoll browse it doesn't exist yet on our git
Identity (CatDap) svn: plain browse git clone mga:software/infrastructure/catdap (git repository currently seems to be empty)
isodumper plain browse git clone mga:software/isodumper
indexhtml plain browse git clone mga:software/indexhtml
kde4-splash-mga plain browse git clone mga:software/desktop/kde/splash
manatools plain browse git clone mga:software/manatools/
mageia-gfxboot-theme plain browse git clone mga:software/design/bootloader-theme
mageia-kde-translation plain browse git clone mga:software/i18n/kde
mgaonline plain browse git clone mga:software/mgaonline
msec plain browse git clone mga:software/msec
net_monitor plain browse git clone mga:software/net_monitor
rpmdrake plain browse git clone mga:software/rpmdrake
system-config-printer plain browse git clone mga:software/i18n/system-config-printer
transfugdrake plain browse git clone mga:software/transfugdrake
urpmi plain browse git clone mga:software/rpm/urpmi
userdrake2 plain browse git clone mga:software/userdrake


Resources branched for Mageia 3 but don't translate them as they reached end of life some time ago

Name pot file location git clone address
drakx_install_mga3 plain browse git clone mga:software/drakx -b distro/mga3 drakx_mga3
drakx_share_mga3 plain browse git clone mga:software/drakx -b distro/mga3 drakx_mga3
drakx_standalone_mga3 plain browse git clone mga:software/drakx -b distro/mga3 drakx_mga3


Unofficial list of *.desktop resources for translation

Name desktop file location git clone or svn checkout address
desktop-mageia-doc-installer browse in svn svn co svn+ssh://USERNAME@svn.mageia.org/svn/soft/mageia-doc/trunk/installer/desktop desktop-mageia-doc-installer
desktop-mageia-doc-mcc browse in svn svn co svn+ssh://USERNAME@svn.mageia.org/svn/soft/mageia-doc/trunk/mcc/desktop desktop-mageia-doc-mcc
desktop-draklive-install plain browse git clone mga:software/build-system/draklive-config
desktop-draklive-register plain browse git clone mga:software/build-system/draklive-config
desktop-mageiawelcome plain browse git clone mga:software/mageiawelcome already moved to pot file
desktop-mageia-kde-banshee-play-audiocd plain browse git clone mga:software/i18n/kde
desktop-mageia-kde-brasero_copy_disc plain browse git clone mga:software/i18n/kde
desktop-mageia-kde-brasero_create_audio_cd_from_blank_medium plain browse git clone mga:software/i18n/kde
desktop-mageia-kde-brasero_create_data_project_from_blank_medium plain browse git clone mga:software/i18n/kde
desktop-mageia-kde-classicPanel plain browse git clone mga:software/desktop/kde/config
desktop-mageia-kde-defaultPanel plain browse git clone mga:software/desktop/kde/config
desktop-mageia-kde-sendmail plain browse git clone mga:software/i18n/kde
desktop-mageia-kde-totem-opendvdl plain browse git clone mga:software/i18n/kde
desktop-mageia-xfce-file-manager plain browse git clone mga:software/desktop/xfce/config should be done upstream
desktop-mageia-xfce-mcc plain browse git clone mga:software/desktop/xfce/config should be done upstream
desktop-mageia-xfce-terminal-emulator plain browse git clone mga:software/desktop/xfce/config should be done upstream
desktop-mageia-xfce-text-editor plain browse git clone mga:software/desktop/xfce/config should be done upstream
desktop-mageia-xfce-web-browser plain browse git clone mga:software/desktop/xfce/config should be done upstream

Unofficial list of *.html resources for translation

Name html file location git clone address
html-mageia-gfxboot-theme_help-boot (note: big update expected) browse html git clone mga:software/design/bootloader-theme
html-mageia-gfxboot-theme_help-install (note: big update expected) browse html git clone mga:software/design/bootloader-theme


List of resources that are not yet ready for translation

Name pot file location git clone address


List of resources of unmaintained software

Name pot file location git clone address
copyiso2usb plain browse git clone mga:software/copyiso2usb
indexhtml_about (abandoned?) plain browse git clone mga:software/indexhtml
drakx_help (looks like it's dead code) plain browse git clone mga:software/drakx
drakx_help_mga3 (looks like it's dead code) plain browse git clone mga:software/drakx -b distro/mga3 drakx_mga3
usbdumper (it seems abandoned, alternative are isodumper and copyiso2usb) plain browse git clone mga:software/usbdumper
Notepad.png
Please note!
This list is probably incomplete. Please add missing resources. Ask on the i18n ml if you are unsure.

Additional Information

Transifex and git syncing