Skip to content

Commit 9f5a323

Browse files
committed
docs: Split commit message conventions from README
We currently only have a very brief outline of the commit message conventions in the README. Improve on that by splitting out the relevant section into a separate file that outlines all conventions we use in addition to the general guidelines in the [handbook]. [handbook]: https://handbook.gnome.org/development/commit-messages.html Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3122>
1 parent 1fdbd77 commit 9f5a323

File tree

2 files changed

+70
-6
lines changed

2 files changed

+70
-6
lines changed

README.md

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,9 @@ All interactions with the project should follow the [Code of Conduct][conduct].
1717

1818
To contribute, open merge requests at https://gitlab.gnome.org/GNOME/gnome-shell.
1919

20-
Commit messages should follow the [GNOME commit message
21-
guidelines](https://wiki.gnome.org/Git/CommitMessages). If a merge request
22-
fixes an existing issue, it is good practice to append the full issue URL
23-
to each commit message. Try to always prefix commit subjects with a relevant
24-
topic, such as `panel:` or `status/network:`, and it's always better to write
25-
too much in the commit message body than too little.
20+
Commit messages should follow the [commit message guidelines][commit-messages].
21+
22+
[commit-messages]: docs/commit-messages.md
2623

2724
## License
2825

docs/commit-messages.md

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
# Commit Messages
2+
3+
Commit messages should follow the guidelines in the [GNOME handbook][handbook].
4+
Please make sure that you have read those recommendations carefully.
5+
6+
The following outlines the additional conventions that are used
7+
in gnome-shell (and mutter).
8+
9+
[handbook]: https://handbook.gnome.org/development/commit-messages.html
10+
11+
## Example
12+
13+
```
14+
status/volume: Automatically mute in vacuum
15+
16+
In space, no one can hear you scream. There is no point
17+
in emitting sound that cannot be perceived, so automatically
18+
mute all output streams.
19+
20+
Closes: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/1234
21+
```
22+
23+
## Description
24+
25+
Try to always prefix commit subjects with a relevant topic, such
26+
as `overview:` or `st/actor:`. Less specific changes can use more
27+
general topics such as `st` or `js`.
28+
29+
As a general rule, it is always better to write too much in the
30+
commit message body than too little.
31+
32+
## References
33+
34+
References should always be expressed as full URL instead of the
35+
`#1234` shorthand, so they still work outside the GitLab UI.
36+
37+
To close an issue automatically, we prefer the `Closes:` keyword
38+
over the alternatives (see next section).
39+
40+
If a merge requests consists of multiple commits and none of them
41+
fixes the issue completely, use the plain issue URL without prefix
42+
as reference, and use the automatic issue closing syntax in the
43+
description of the merge request.
44+
45+
Do not add any `Part-of:` line, as that will be handled automatically
46+
when merging.
47+
48+
## The Fixes tag
49+
50+
If a commit fixes a regression caused by a particular commit, it
51+
can be marked with the `Fixes:` tag. To produce such a tag, use
52+
53+
```
54+
git show -s --pretty='format:Fixes: %h ("%s")' <COMMIT>
55+
```
56+
57+
or create an alias
58+
59+
```
60+
git config --global alias.fixes "show -s --pretty='format:Fixes: %h (\"%s\")'"
61+
```
62+
63+
and then use
64+
65+
```
66+
git fixes <COMMIT>
67+
```

0 commit comments

Comments
 (0)