You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A common theme in PR reviews has been discussing the level of detail
that should be included in commit messages, as well as how to craft a
series of commits in a PR that helps guide a reviewer through the
changes made to accomplish the overall goal of the PR.
This adds some text we can point to on this topic that provides some
helpful explanations and examples of commit message and commit series
best practices.
Signed-off-by: Russell Bryant <rbryant@redhat.com>
Copy file name to clipboardexpand all lines: docs/github-merge-strategy.md
+41-1
Original file line number
Diff line number
Diff line change
@@ -6,6 +6,46 @@ This document describes the merge strategy used for Pull Requests within all rep
6
6
7
7
Every Pull Request that is made to an InstructLab repository should meet the below requirements - certain repositories such as [taxonomy](https://github.com/instruct-lab/taxonomy) may have additional requirements.
8
8
9
+
### Commit Messages and PR Description
10
+
11
+
PRs should be formatted as a series of logical commits that implement the
12
+
overall change proposed in the PR. Each commit should represent a logical step
13
+
in the progression of the change. The commit message for each should clearly
14
+
explain that step of the progression.
15
+
16
+
Here are a few examples of PRs that contained a series of commits:
We should require that all CI checks pass on a Pull Request before it can be considered for merge. Every repository should have at mimimum the following checks:
@@ -28,7 +68,7 @@ There are [three different merge methods offered by GitHub](https://docs.github.
28
68
29
69
We use the default merge method of creating merge commits for PRs. This is to ensure we retain the full commit history as intentionally structured by the PR author while also retaining metadata about the PR itself in the merge commit.
30
70
31
-
This requires project maintainers to include commit messages and the overall structure of the commit series as part of their review. When multiple commits are present, they should represent a logical series of changes that implement the overall change proposed in the PR. The commit message for each should clearly explain that step of the progression.
71
+
This requires project maintainers to include commit messages and the overall structure of the commit series as part of their review.
32
72
33
73
It is common that a PR author may need to do a final rebase to clean up their proposed commit series before a PR can be merged. It is also fine for a project maintainer to perform this step when the changes necessary are straight forward enough to do so. This includes doing a final rebase on `main` if necessary. The PR itself should NOT include any merge commits of `main` back into the developer's branch. We expect the proposed commit series to be a clean set of commits against `main` without conflicts or merge commit history. We only use a merge commit to record the PR's inclusion into `main`.
0 commit comments