projects/aports·blob v3.19.0_rc3 · refs

316 lines · 6.4 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 repository.

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


Addition of maintainership

Adding yourself as maintainer.

Template

  • $repository/$pkgname: take over maintainership

Example: community/foo: take over maintainership

Rules

One commit per aport assumed maintainership of.


Removal of maintainership

Removing yourself as maintainer.

Template

  • $repository/$pkgname: drop maintainership

Example: community/foo: drop maintainership

Rules

One commit per aport maintainership is removed from.

Exceptions

When removing maintainership from all aports you maintain, the commit can hold all maintainership removals but instead be split by repository.

Example: community/*: drop maintainership


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 repository.
186
187Example: `community/*: rebuild for so:libfoo.so.2`
188
189---
190
191### Addition of maintainership
192
193Adding yourself as maintainer.
194
195#### Template
196
197- `$repository/$pkgname: take over maintainership`
198
199Example: `community/foo: take over maintainership`
200
201#### Rules
202
203One commit per aport assumed maintainership of.
204
205---
206
207### Removal of maintainership
208
209Removing yourself as maintainer.
210
211#### Template
212
213- `$repository/$pkgname: drop maintainership`
214
215Example: `community/foo: drop maintainership`
216
217#### Rules
218
219One commit per aport maintainership is removed from.
220
221#### Exceptions
222
223When removing maintainership from all aports you maintain, the commit can
224hold all maintainership removals but instead be split by repository.
225
226Example: `community/*: drop maintainership`
227
228<!--
229Missing improvements
230Also missing tree-wide changes like usage of abuild-meson instead of meson
231-->
232
233---
234
235### Other
236
237Any set of changes not specified above falls under this type.
238
239#### Template
240
241If the commit changes an aport:
242
243- `$repository/$pkgname: <action>`
244
245If the commit changes anything else in the repository:
246
247- `$directory_or_file: <action>`
248 - If the file is inside a directory use the directory, if inside a file use the name of the file
249
250`<action>` is what is the commit is doing. Be **short** and **direct**.
251
252Examples:
253
254- `main/foo: fix policy violations`
255- `scripts/: enable compilation under mips64el`
256
257#### Rules
258
259It is **essential** to include reasoning for the changes in the body of the
260commit.
261
262Universal Title writing rules
263-----------------------------
264
265Applies to all commits, regardless of type.
266
267### Imperative, Present Tense
268
269Use the Present Tense and the Imperative mood
270
271Examples:
272
273- `main/foo: remove stale patches`
274- `community/bar: patch CVE-YYYY-XXXXX`
275- `testing/baz: fix policy violations`
276
277### Lowercase, No dot
278
279Text after the colon must start in lowercase and have no dot at the end.
280
281### Direct, Short
282
283Focus on **what** the commit does and use as few words as possible.
284
285If possible also tell **why**.
286
287Good examples:
288
289- `main/foo: fix build under gcc-10`
290 - `fix build` is **what**
291 - `under gcc-10` is **why**
292- `main/foo: disable support for X`
293 - `disable support for X` is **what**
294- `main/foo: add fish completion`
295 - `add fish completion` is **what**
296- `main/foo: enable on x86`
297 - `enable on x86` is **what**
298- `main/foo: rebuild for so:foo.so.2`
299 - `rebuild` is **what**
300 - `for so:foo.so.2` is **why**
301
302They are short and concise, they tell **what** the commit did. If given
303the opportunity also tell **why**.
304
305The **how** and a clear **why** is handled by the commit body and changes.
306
307### Assume basic knowledge, Avoid unnecessary explanations
308
309The reader does not need to be told how the complex details of something work,
310just that it was the reason the change was done.
311
312Example:
313
314Don't tell the user how sonames work and how an ELF binary finds libraries
315to load via the soname, just tell the soname has changed and thus a rebuild was
316required.