Skip to content

Commit

Permalink
CONTRIBUTING.md: move and shorten commit message advice
Browse files Browse the repository at this point in the history
  • Loading branch information
tertsdiepraam committed Nov 7, 2023
1 parent 1a457c0 commit 59efe75
Showing 1 changed file with 28 additions and 63 deletions.
91 changes: 28 additions & 63 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,34 @@ To ensure easy collaboration, we have guidelines for using Git and GitHub.
- Annotate your commit message with the component you're editing. For example: `cp: do not overwrite on with -i` or `uucore: add support for FreeBSD`.
- Do not unnecessarily move items around in the code. This makes the changes much harder to review. If you do need to move things around, do that in a separate commit.

### Commit messages

You can read this section in the Git book to learn how to write good commit messages: https://git-scm.com/book/ch5-2.html.

In addition, here are a few examples for a summary line when committing to uutils:

- commit for a single utility

```
nohup: cleanup and refactor
```

- commit for a utility's tests

```
tests/rm: test new feature
```

Beyond changes to an individual utility or its tests, other summary lines for
non-utility modules include:

```
README: add help
uucore: add new modules
uutils: add new utility
gitignore: add temporary files
```

### PRs

- Make the titles of PRs descriptive.
Expand Down Expand Up @@ -246,69 +274,6 @@ To improve the GNU compatibility, the following process is recommended:
1. Start to modify the Rust implementation to match the expected behavior
1. Add a test to make sure that we don't regress (our test suite is super quick)

## Commit messages

To help the project maintainers review pull requests from contributors across
numerous utilities, the team has settled on conventions for commit messages.

From <https://git-scm.com/book/ch5-2.html>:

```
Capitalized, short (50 chars or less) summary
More detailed explanatory text, if necessary. Wrap it to about 72
characters or so. In some contexts, the first line is treated as the
subject of an email and the rest of the text as the body. The blank
line separating the summary from the body is critical (unless you omit
the body entirely); tools like rebase will confuse you if you run the
two together.
Write your commit message in the imperative: "Fix bug" and not "Fixed bug"
or "Fixes bug." This convention matches up with commit messages generated
by commands like git merge and git revert.
Further paragraphs come after blank lines.
- Bullet points are okay, too
- Typically a hyphen or asterisk is used for the bullet, followed by a
single space, with blank lines in between, but conventions vary here
- Use a hanging indent
```

Furthermore, here are a few examples for a summary line:

- commit for a single utility

```
nohup: cleanup and refactor
```

- commit for a utility's tests

```
tests/rm: test new feature
```

Beyond changes to an individual utility or its tests, other summary lines for
non-utility modules include:

```
README: add help
```

```
uucore: add new modules
```

```
uutils: add new utility
```

```
gitignore: add temporary files
```

## Code coverage

Expand Down

0 comments on commit 59efe75

Please sign in to comment.