<commit_before># Contributing to Qbs

The main source code repository is hosted at
[codereview.qt-project.org](https://codereview.qt-project.org/q/project:qbs/qbs).

The Qbs source code is also mirrored on [code.qt.io](https://code.qt.io/cgit/qbs/qbs.git/)
and on [GitHub](https://github.com/qbs/qbs). Please note that those mirrors
are read-only and we do not accept pull-requests on GitHub. However, we gladly
accept contributions via [Gerrit](https://codereview.qt-project.org/q/project:qbs/qbs).

This document briefly describes steps required to be able to propose changes
to the Qbs project.

See the [Qt Contribution Guidelines](https://wiki.qt.io/Qt_Contribution_Guidelines)
page, [Setting up Gerrit](https://wiki.qt.io/Setting_up_Gerrit) and
[Gerrit Introduction](https://wiki.qt.io/Gerrit_Introduction) for more
details about how to upload patches to Gerrit.

## Preparations

* [Set up](https://wiki.qt.io/Setting_up_Gerrit#How_to_get_started_-_Gerrit_registration)
a Gerrit account
* Tweak your SSH config as instructed [here](https://wiki.qt.io/Setting_up_Gerrit#Local_Setup)
* Use the recommended Git settings, defined [here](https://wiki.qt.io/Setting_up_Gerrit#Configuring_Git)
* Get the source code as described below

## Cloning Qbs

Clone Qbs from the [code.qt.io](https://code.qt.io/cgit/qbs/qbs.git/) mirror
```
git clone git://code.qt.io/qbs/qbs.git
```
Alternatively, you can clone from the mirror on the [GitHub](https://github.com/qbs/qbs)
```
git clone https://github.com/qbs/qbs.git
```

Set up the Gerrit remote
```
git remote add gerrit ssh://<gerrit-username>@codereview.qt-project.org:29418/qbs/qbs
```

## Setting up git hooks

Install the hook generating Commit-Id files into your top level project directory:
```
gitdir=$(git rev-parse --git-dir); scp -P 29418 codereview.qt-project.org:hooks/commit-msg ${gitdir}/hooks/
```

This hook automatically adds a "Change-Id: …" line to the commit message. Change-Id is used
to identify new Patch Sets for existing
[Changes](https://wiki.qt.io/Gerrit_Introduction#Terminology).

## Making changes

Commit your changes in the usual way you do in Git.

After making changes, you might want to ensure that Qbs can be built and autotests pass:
```
qbs build -p autotest-runner
```<commit_msg>doc: some tweaks to the CONTRIBUTING.md<commit_after># Contributing to Qbs

The main source code repository is hosted at
[codereview.qt-project.org](https://codereview.qt-project.org/q/project:qbs/qbs).

The Qbs source code is also mirrored on [code.qt.io](https://code.qt.io/cgit/qbs/qbs.git/)
and on [GitHub](https://github.com/qbs/qbs). Please note that those mirrors
are read-only and we do not accept pull-requests on GitHub. However, we gladly
accept contributions via [Gerrit](https://codereview.qt-project.org/q/project:qbs/qbs).

This document briefly describes steps required to be able to propose changes
to the Qbs project.

See the [Qt Contribution Guidelines](https://wiki.qt.io/Qt_Contribution_Guidelines)
page, [Setting up Gerrit](https://wiki.qt.io/Setting_up_Gerrit) and
[Gerrit Introduction](https://wiki.qt.io/Gerrit_Introduction) for more
details about how to upload patches to Gerrit.

## Preparations

* [Set up](https://wiki.qt.io/Setting_up_Gerrit#How_to_get_started_-_Gerrit_registration)
a Gerrit account
* Tweak your SSH config as instructed [here](https://wiki.qt.io/Setting_up_Gerrit#Local_Setup)
* Use the recommended Git settings, defined [here](https://wiki.qt.io/Setting_up_Gerrit#Configuring_Git)
* Get the source code as described below

## Cloning Qbs

Clone Qbs from the [code.qt.io](https://code.qt.io/cgit/qbs/qbs.git/) mirror
```
git clone git://code.qt.io/qbs/qbs.git
```
Alternatively, you can clone from the mirror on the [GitHub](https://github.com/qbs/qbs)
```
git clone https://github.com/qbs/qbs.git
```

Set up the Gerrit remote
```
git remote add gerrit ssh://<gerrit-username>@coder<EMAIL>.qt-project.org:29418/qbs/qbs
```

## Setting up git hooks

Install the hook generating Commit-Id files into your top level project directory:
```
gitdir=$(git rev-parse --git-dir); scp -p -P 29418 codereview.qt-project.org:hooks/commit-msg "${gitdir}/hooks/"
```

This hook automatically adds a "Change-Id: …" line to the commit message. Change-Id is used
to identify new Patch Sets for existing
[Changes](https://wiki.qt.io/Gerrit_Introduction#Terminology).

## Making changes

Commit your changes in the usual way you do in Git.

After making changes, you might want to ensure that Qbs can be built and autotests pass:
```
qbs build -p autotest-runner
```
{'fraction_non_alphanumeric': 0.1242603550295858, 'fraction_numerical': 0.0043830813061582295, 'mean_word_length': 4.726474278544542, 'pattern_counts': {'":': 0, '<': 6, '<?xml version=': 0, '>': 6, 'https://': 28, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '454950', 'n_tokens_mistral': 1566, 'n_tokens_neox': 1469, 'n_words': 458}