Jump to content

Gerrit/Посібник/tl;dr

From mediawiki.org
This page is a translated version of the page Gerrit/Tutorial/tl;dr and the translation is 14% complete.
Outdated translations are marked like this.
Це дуже короткий (tl;dr) посібник із використання Git і Gerrit для розробки MediaWiki. Посібник, який містить пояснення, див. Gerrit/Посібник .

Prerequisites

Отримати код:

Clone the repository using the command in the repository browser (e.g. https://gerrit.wikimedia.org/g/mediawiki/core). You can find these on the list, or from the extension infobox on mediawiki.org. The most commonly cloned repositories are:

Для ядра MediaWiki: git clone https://gerrit.wikimedia.org/r/mediawiki/core.git mediawiki

Або, для розширення: git clone https://gerrit.wikimedia.org/r/mediawiki/extensions/<розширення>.git

MediaWiki skins: git clone https://gerrit.wikimedia.org/r/mediawiki/skins/<skin-name>.git

Write your patch

Start your branch from the latest production branch:

mediawiki$ git checkout master
mediawiki$ git pull
mediawiki$ git checkout -b meaningful-branch-name
NOTE: In some cases, the production branch may be called "production" or "main" and require a modified checkout command such as:
mediawiki$ git checkout production
mediawiki$ git checkout main

Now you can edit the code to make and test your changes. Once you are satisfied and the code is operational ready:

  • git commit --all When working with Gerrit, do this only once per branch. To fix mistakes, use git commit --amend.
  • git show Review your patch to confirm what you are submitting to us. Press "q" to quit.
  • git review This pushes to Gerrit and creates a change request. If you receive an error and have previously installed the older "gerrit-tools" program, install "git-review" instead.

You are encouraged to invite one or two maintainers as reviewers on your change. After creating the change request, the git review will have printed the URL for you change request. You can also find your changes through your Gerrit dashboard. On the change page, under "Reviewers", click the "Add Reviewer" pencil button. Write a reviewer name in the input box. If you don't know who to invite for reviewing, check the maintainers list for the component you've modified, or ask on IRC (#mediawiki connect).

Update your patch

If a reviewer asks you to make changes, amend your commit as follows:

  • git review -d change_ID e.g. 1234 in https://gerrit.wikimedia.org/r/1234. This downloads and checks out the change request from Gerrit.
  • Edit the source files to make your changes.
  • git commit --all --amend You can run this as many times as you like. When editing the commit message, leave the "Change-Id" line intact.
  • git review This updates your change request in Gerrit, with a new patch set version reflecting your change, and automatically notifies the subscribed reviewers.

See also