Outdated translations are marked like this.
- Це дуже короткий (tl;dr) посібник із використання Git і Gerrit для розробки MediaWiki. Посібник, який містить пояснення, див. Gerrit/Посібник .
Перші кроки:
- Встановити та налаштувати Git.
- Створити ключ SSH (для Gerrit достатньо кроків 1-3). Створити обліковий запис розробника Вікімедіа.
- Увійти й додати свій відкритий ключ до gerrit.
- Додати свій відкритий ключ також до LDAP за допомогою інтерфейсу toolsadmin або Special:NovaKey на wikitech.
- Встановити та налаштувати git-review. and set it up .
Отримати код:
- Для ядра MediaWiki:
git clone ssh://<username>@gerrit.wikimedia.org:29418/mediawiki/core.git mediawiki
- Або, для розширення:
git clone ssh://<username>@gerrit.wikimedia.org:29418/mediawiki/extensions/<розширення>.git
- Or, for a skin:
git clone ssh://<username>@gerrit.wikimedia.org:29418/mediawiki/skins/<skin-name>.git
Напишіть і надішліть свій новий код:
git checkout master
git pull
git checkout -b <meaningful-branch-name>
# Now write some code. See the Git commands "add", "rm" and "mv" to add, remove or rename files. When the code is ready:
git commit --all # In the Gerrit world, you should do this only once per branch! Remember to follow the commit message guidelines.
git show # Make sure that you are sending what you want to send. Press "q" to quit.
git review -R # This sends your code to Gerrit.
- If you receive errors with the "-R" switch you may be using out of date "gerrit-tools" instead of "git-review"
- On Gerrit, click your change. Under "Reviewers", click the "Add Reviewer" button. Write a reviewer name in the input box. If you don't know who to invite for reviewing, try the maintainer for the component you've edited, or ask on IRC (#wikimedia-dev connect).
If the reviewer asks you to make a change, make it and amend your commit:
git review -d <change ID or URL of patch> # e.g. 1234 in gerrit.wikimedia.org/r/1234 or https://gerrit.wikimedia.org/r/c/mediawiki/core/+/1234
# Make the needed changes to the source files.
git commit --all --amend # You can do this more than once. You can change the commit message, but make sure to leave the "Change-Id" line intact.
git review -R # This creates a new patch set in the same Gerrit change, and sends an invitation to review the code again.
To review other people's code, just follow the same steps to amend a change described above, using the corresponding <change ID>
.