projects/aports·blob v3.17.9 · refs

277 lines · 5.7 KiB

Policy for commits in aports

This document defines policy for organizing and titling commits for inclusion in aports.

Glossary

Definition used for the following terms.

Repository

Where the aport resides, it is the penultimate repository in the path of the aport.

Example: main/foo/APKBUILD, main is the repository

Aport

Directory inside the repository that contains a build recipe with metadata (APKBUILD) and auxiliary files.

The name of the directory and the value of the variable pkgname in the build recipe must match.

Example: main/foo/APKBUILD, foo is the aport

Commits

Set of changes to files as recorded by git with other metadata like title, message and an autogenerated ID.

Merge Request

Proposal of a set of commits to be merged into a branch of a repository.

This is what maintainers review, and what Continous Integration checks to guarantee it won’t break anything.

In Alpine Linux’ aports terms this is commonly the master branch of the repo. Other branches like 3.X-stable are used to push to released versions.

Organizing

Commits should be split by function and what aport they change, one commit per aport changed, and one commit per type of change.

Commits that are related to the same aport or are closely related must be under the same Merge Request.

Exceptions to these organization rules may apply depending on the situation, as noted below.

Commit types

Different sets of changes in a commit award a different type that has a distinct template, rules and exceptions to follow when organizing and titling.


Upgrade

Increases the value of pkgver, and sets the value of pkgrel to 0.

Template
  • $repository/$pkgname: upgrade to $pkgver

Example: main/foo: upgrade to 2.0.0

Rules

One commit per upgraded aport.

Exceptions

Upgrading lots of aports that are maintained upstream in lockstep (same version and released at the same time) can be all in the same commit

Example: KDE Plasma Framework


Downgrade

Decreases the value of pkgver, and increases the value of pkgrel by 1 in relation to the value of pkgrel before the last upgrade.

Template
  • $repository/$pkgname: downgrade to $pkgver

Example: main/foo: downgrade to 1.9.8

Rules

One commit per downgraded aport.


Move

Moves an aport from one repository to another.

Template
  • $newrepository/$pkgname: move from $oldrepository

Example: community/foo: move from main

Rules

One commit per moved aport.


Rename

Renames an aport.

Template
  • $repository/$newpkgname: rename from $oldpkgname

Example: community/bar: rename from foo

Rules

One commit per renamed aport.


Add

Introduces a new aport.

Template
  • $repository/$pkgname: new aport

Example: testing/bar: new aport

Rules

One commit per aport introduced.


Remove

Removes an aport from aports altogether.

Template

  • $repository/$pkgname: remove

Example: community/baz: remove

Rules

One commit per removed aport.


Rebuilds

Only increasing the value of pkgrel by 1.

Template

  • $repository/$pkgname: rebuild <reason-if-exists>

Example: community/foo: rebuild

Rules

One commit per rebuilt aport.

Exceptions

When various aports need to be rebuilt for the same reason the commit can hold all Rebuilds but split instead by by repository.

Example: community/*: rebuild for so:libfoo.so.2


Other

Any set of changes not specified above falls under this type.

Template

If the commit changes an aport:

  • $repository/$pkgname: <action>

If the commit changes anything else in the repository:

  • $directory_or_file: <action>
    • If the file is inside a directory use the directory, if inside a file use the name of the file

<action> is what is the commit is doing. Be short and direct.

Examples:

  • main/foo: fix policy violations
  • scripts/: enable compilation under mips64el

Rules

It is essential to include reasoning for the changes in the body of the commit.

Universal Title writing rules

Applies to all commits, regardless of type.

Imperative, Present Tense

Use the Present Tense and the Imperative mood

Examples:

  • main/foo: remove stale patches
  • community/bar: patch CVE-YYYY-XXXXX
  • testing/baz: fix policy violations

Lowercase, No dot

Text after the colon must start in lowercase and have no dot at the end.

Direct, Short

Focus on what the commit does and use as few words as possible.

If possible also tell why.

Good examples:

  • main/foo: fix build under gcc-10
    • fix build is what
    • under gcc-10 is why
  • main/foo: disable support for X
    • disable support for X is what
  • main/foo: add fish completion
    • add fish completion is what
  • main/foo: enable on x86
    • enable on x86 is what
  • main/foo: rebuild for so:foo.so.2
    • rebuild is what
    • for so:foo.so.2 is why

They are short and concise, they tell what the commit did. If given the opportunity also tell why.

The how and a clear why is handled by the commit body and changes.

Assume basic knowledge, Avoid unnecessary explanations

The reader does not need to be told how the complex details of something work, just that it was the reason the change was done.

Example:

Don’t tell the user how sonames work and how an ELF binary finds libraries to load via the soname, just tell the soname has changed and thus a rebuild was required.

1Policy for commits in aports
2============================
3
4This document defines policy for organizing and titling commits for
5inclusion in aports.
6
7Glossary
8---------
9
10Definition used for the following terms.
11
12##### Repository
13
14Where the aport resides, it is the penultimate repository in the path of
15the aport.
16
17Example: `main/foo/APKBUILD`, `main` is the repository
18
19##### Aport
20
21Directory inside the repository that contains a build recipe with metadata
22(APKBUILD) and auxiliary files.
23
24The name of the directory and the value of the variable `pkgname` in the
25build recipe **must** match.
26
27Example: `main/foo/APKBUILD`, `foo` is the aport
28
29##### Commits
30
31Set of changes to files as recorded by git with other metadata like title,
32message and an autogenerated ID.
33
34##### Merge Request
35
36Proposal of a set of commits to be merged into a branch of a repository.
37
38This is what maintainers review, and what Continous Integration checks to
39guarantee it won't break anything.
40
41In Alpine Linux' aports terms this is commonly the `master` branch of the
42repo. Other branches like `3.X-stable` are used to push to released versions.
43
44Organizing
45----------
46
47Commits should be split by function and what aport they change, one commit
48per aport changed, and one commit per type of change.
49
50Commits that are related to the same aport or are closely related must be
51under the same Merge Request.
52
53Exceptions to these organization rules may apply depending on the situation,
54as noted below.
55
56Commit types
57------------
58
59Different sets of changes in a commit award a different type that has a
60distinct template, rules and exceptions to follow when organizing and titling.
61
62---
63
64### Upgrade
65
66Increases the value of `pkgver`, and sets the value of `pkgrel` to 0.
67
68###### Template
69
70- `$repository/$pkgname: upgrade to $pkgver`
71
72Example: `main/foo: upgrade to 2.0.0`
73
74###### Rules
75
76One commit per upgraded aport.
77
78###### Exceptions
79
80Upgrading lots of aports that are maintained upstream in lockstep (same version
81and released at the same time) can be all in the same commit
82
83Example: KDE Plasma Framework
84
85---
86
87### Downgrade
88
89Decreases the value of `pkgver`, and increases the value of `pkgrel` by 1 in
90relation to the value of `pkgrel` before the last upgrade.
91
92###### Template
93
94- `$repository/$pkgname: downgrade to $pkgver`
95
96Example: `main/foo: downgrade to 1.9.8`
97
98###### Rules
99
100One commit per downgraded aport.
101
102---
103
104### Move
105
106Moves an aport from one repository to another.
107
108###### Template
109
110- `$newrepository/$pkgname: move from $oldrepository`
111
112Example: `community/foo: move from main`
113
114###### Rules
115
116One commit per moved aport.
117
118---
119
120### Rename
121
122Renames an aport.
123
124###### Template
125
126- `$repository/$newpkgname: rename from $oldpkgname`
127
128Example: `community/bar: rename from foo`
129
130###### Rules
131
132One commit per renamed aport.
133
134---
135
136### Add
137
138Introduces a new aport.
139
140###### Template
141
142- `$repository/$pkgname: new aport`
143
144Example: `testing/bar: new aport`
145
146###### Rules
147
148One commit per aport introduced.
149
150---
151
152### Remove
153
154Removes an aport from aports altogether.
155
156#### Template
157
158- `$repository/$pkgname: remove`
159
160Example: `community/baz: remove`
161
162#### Rules
163
164One commit per removed aport.
165
166---
167
168### Rebuilds
169
170Only increasing the value of `pkgrel` by 1.
171
172#### Template
173
174- `$repository/$pkgname: rebuild <reason-if-exists>`
175
176Example: `community/foo: rebuild`
177
178#### Rules
179
180One commit per rebuilt aport.
181
182#### Exceptions
183
184When various aports need to be rebuilt for the same reason the commit can
185hold all `Rebuilds` but split instead by by repository.
186
187Example: `community/*: rebuild for so:libfoo.so.2`
188
189<!--
190Missing improvements
191Also missing tree-wide changes like usage of abuild-meson instead of meson
192-->
193
194---
195
196### Other
197
198Any set of changes not specified above falls under this type.
199
200#### Template
201
202If the commit changes an aport:
203
204- `$repository/$pkgname: <action>`
205
206If the commit changes anything else in the repository:
207
208- `$directory_or_file: <action>`
209 - If the file is inside a directory use the directory, if inside a file use the name of the file
210
211`<action>` is what is the commit is doing. Be **short** and **direct**.
212
213Examples:
214
215- `main/foo: fix policy violations`
216- `scripts/: enable compilation under mips64el`
217
218#### Rules
219
220It is **essential** to include reasoning for the changes in the body of the
221commit.
222
223Universal Title writing rules
224-----------------------------
225
226Applies to all commits, regardless of type.
227
228### Imperative, Present Tense
229
230Use the Present Tense and the Imperative mood
231
232Examples:
233
234- `main/foo: remove stale patches`
235- `community/bar: patch CVE-YYYY-XXXXX`
236- `testing/baz: fix policy violations`
237
238### Lowercase, No dot
239
240Text after the colon must start in lowercase and have no dot at the end.
241
242### Direct, Short
243
244Focus on **what** the commit does and use as few words as possible.
245
246If possible also tell **why**.
247
248Good examples:
249
250- `main/foo: fix build under gcc-10`
251 - `fix build` is **what**
252 - `under gcc-10` is **why**
253- `main/foo: disable support for X`
254 - `disable support for X` is **what**
255- `main/foo: add fish completion`
256 - `add fish completion` is **what**
257- `main/foo: enable on x86`
258 - `enable on x86` is **what**
259- `main/foo: rebuild for so:foo.so.2`
260 - `rebuild` is **what**
261 - `for so:foo.so.2` is **why**
262
263They are short and concise, they tell **what** the commit did. If given
264the opportunity also tell **why**.
265
266The **how** and a clear **why** is handled by the commit body and changes.
267
268### Assume basic knowledge, Avoid unnecessary explanations
269
270The reader does not need to be told how the complex details of something work,
271just that it was the reason the change was done.
272
273Example:
274
275Don't tell the user how sonames work and how an ELF binary finds libraries
276to load via the soname, just tell the soname has changed and thus a rebuild was
277required.