Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
88 changes: 70 additions & 18 deletions Docs/Engine/GitPolicy.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,35 +60,87 @@ Version numbers **must not** appear in commit messages.

## 3. Branches

The project allows the following branch types:
| Branch | What it is | How code gets in |
|---|---|---|
| `master` | what is released | a pull request from `develop` |
| `develop` | active development and integration | a pull request from a work branch |
| `feature/*` | one task | commits |
| `experiment/*` | temporary or high-risk research work | commits |

* `main` — stable integration branch
* `develop` — active development and integration
* `feature/*` — development of specific systems or technologies
* `experiment/*` — temporary or high-risk research work
`master` and `develop` take pull requests only: nobody pushes there, the owner included. A work branch may be rewritten
or abandoned; once merged it is deleted.

Branches may be:
---

* deleted without preservation
* rewritten
* abandoned
## 4. The way of a change

This is expected and acceptable.
The same in the core, in a module and in a tool. Each is a repository of its own: run the commands in its folder.

---
### 4.1 Every day

## 4. Merging
```powershell
# 1. A branch, from a fresh develop
git switch develop
git pull --ff-only
git switch -c feature/<task>

Before merging into `main`:
# 2. Commits, small ones. The hooks check the marks
git add .
git commit -m "[TAG] <verb> <what changed>"

* the code must build
* changes must be logically complete
* commit history must remain readable
# 3. A pull request into develop
git push -u origin HEAD
gh pr create -B develop --fill

Versions (Git tags) are **created only on `main`**.
# 4. Merged once everything is green
gh pr checks --watch
gh pr merge --merge --delete-branch

---
# 5. Back to develop
git switch develop
git pull --ff-only
```

More commits on the same task before the merge: `git commit` and `git push`, the pull request takes them by itself.

Always a **merge commit**, never a squash or a rebase: those make other commits out of the same changes, and `develop`
and `master` drift apart.

### 4.2 A change of several repositories

The one the others use goes first: the core, then the modules. At a release it is the other way round (4.3).

### 4.3 A release

A snapshot of the mirror takes `master` of every component, so the core goes last:

1. each module that changed: a pull request from `develop` into `master`, merged;
2. the core: the new versions in `Shared/Build/Stellar.Versions.props` through a usual pull request into `develop`;
3. the core: a pull request from `develop` into `master`. **Its merge releases the version**;
4. the mirror: Run workflow of *Mirror* in StellarEngine-Mono, unless the release started it.

```powershell
gh pr create -B master -H develop -t "<name> <version>" -b "<what it is, in a sentence>"
gh pr checks develop --watch
gh pr merge develop --merge
```

`develop` is not deleted, and `master` is never merged back by hand.

### 4.4 When something is in the way

| What you see | What to do |
|---|---|
| the commit is stopped by a mark | `stellar marks list`, look at the place, take the mark out or leave the file out of the commit |
| `push` says *protected branch* | you are on `develop` or `master`: `git switch -c feature/<task>` and push that; the commits come with you |
| the pull request says *out of date* or *conflicts* | `git fetch origin`, `git merge origin/develop` in the work branch, solve, commit, push |
| a check is red | open it, fix in the same branch, push |
| `pull --ff-only` refuses | there are commits on `develop` that are not on the server: `git switch -c feature/<task>`, then `git branch -f develop origin/develop` |

Before merging into `master` the code must build, changes must be logically complete, and the history must remain
readable. Versions (Git tags) are **created only on `master`**.

---
## 5. Git Tags

### 5.1 Version Tags
Expand Down
Loading