# Release digest

> Group the commits in the digest of each release with rules that match the commit subject.

Every release page has a **Digest** section that lists the commits between the release and the release that it compares with. See [Compare releases](/releases/compare). Genesis has no digest, because it compares with no earlier release.

Digest rules sort these commits into groups, such as **Features** and **Fixes**. The rules belong to the project and apply to all its releases. Patchbay shows the digest on the release page and does not send it anywhere.

## How Patchbay sorts a commit

Patchbay reads the subject of each commit, which is the first line of the commit message. If the subject ends with the pull request number, for example `(#42)`, Patchbay removes the number first.

Each rule has one or more expressions, which are regular expressions that Patchbay matches against the subject. Patchbay sorts each commit in this order:

1. Patchbay checks the expressions of the **Other** rule first, and a match puts the commit in **Other**.
2. Then Patchbay checks the other rules in their list order, and the first rule with a matching expression gets the commit.
3. A commit that matches no rule goes to **Other**.

A rule can be hidden, and the digest does not show the commits of a hidden rule. **Other** is hidden by default, so to keep commits out of the digest, add an expression that matches them to **Other**.

## Default rules

A new project has one rule for each type of Conventional Commits, and **Other**:

| Rule | Matches subjects that start with |
|---|---|
| **Features** | `feat` |
| **Fixes** | `fix` |
| **Refactors** | `refactor` |
| **Performance** | `perf` |
| **Docs** | `docs` |
| **Tests** | `test` |
| **Styles** | `style` |
| **Chores** | `chore` |
| **CI** | `ci` |
| **Build** | `build` |
| **Other** | Nothing. It collects every commit that no rule matches. Hidden by default. |

Each type can have a scope and a `!`, followed by a colon. For example, the **Fixes** rule matches `fix(api): handle empty input` and `fix!: drop the old flag`.

<Media id="digest-rules" label="The Digest settings of a Project, with the default rules, one custom rule named Security, and the Other rule in the Hidden group." />

## Change the rules

You need the **Admin** role on the project to change the rules, and other members can only read them.

1. Open the project and press `Cmd+K` (or `Ctrl+K`).
2. Select **Project settings**, and then select **Digest**.
3. Click **Add rule**, and type a name in the **Rule name** field. To change the icon and color, click the icon next to the name.
4. Click **Expression**, and type a **Label** and a **Subject regex**, for example `^security(\(.+\))?:`.
5. Click **Create rule**.

Patchbay adds a new rule at the end of the list, so it checks the new rule after the rules above it. You cannot change the order of the rules, and sorting the table by **Name** does not change the order that Patchbay uses.

In the rules table, you can also change the rules you have:

- To rename a rule, click its name and type a new one.
- To edit the expressions of a rule, click the number in the **Rules** column.
- To hide a rule or show it again, click **Hide by default** or **Show by default**.
- To delete a rule, click the delete icon in its row. You can delete every rule except **Other**.

The table groups the rules in **Active** and **Hidden**. Two rules cannot have the same name, and Patchbay rejects an expression that is not a valid regular expression. Expressions use the RE2 syntax of Go.

## Read the digest

On a release page, open the menu next to the **Digest** title and select a **Group by** value:

- **Change type** shows one group for each rule that has commits.
- **Component** shows one group for each component, and a commit that touched several components shows under each of them.

Both views leave out the commits of hidden rules.

Index of all pages: https://patchbay.unbrikd.com/docs/llms.txt
