Skip to content

docs: contributing: add exercpt about rewriting branches#159

Closed
JGBSouza wants to merge 1 commit intokworkflow:unstablefrom
JGBSouza:docs/add_excerpt_rewriting_branches
Closed

docs: contributing: add exercpt about rewriting branches#159
JGBSouza wants to merge 1 commit intokworkflow:unstablefrom
JGBSouza:docs/add_excerpt_rewriting_branches

Conversation

@JGBSouza
Copy link

@JGBSouza JGBSouza commented Oct 5, 2025

This commit adds a new subsection, “Rewriting Branches”, to the Pull Request Guidelines in the contributing.md file.
The new section explains what branch rewriting is, why it’s essential for contributing to the Patch Hub project, and
links to the official Git documentation for more detailed guidance.

Rewriting branches is a key skill in Patch Hub’s contribution workflow, helping ensure pull requests remain clean,
focused, and easy to review. It also maintains a meaningful Git history, which improves long-term maintainability and
version tracking.

Closes #151

Copy link
Collaborator

@lorenzoberts lorenzoberts left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @JGBSouza, thanks for the contribution! Let me know if my comments make sense.

Besides that, regarding the commit message, i think it's better for us to start it by directly saying what the commit does: "This commit adds/..". After that, if you want to add a more "abstract" reflection of the commit importance, or anything not so direct, feel free to do it. You can also add the reference to the issue in the commit itself, not only in the PR. Example

CONTRIBUTING.md Outdated

You may find more about it at: [Git Tools: Rewriting History](https://git-scm.com/book/en/v2/Git-Tools-Rewriting-History)

#### What are we talking about
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
#### What are we talking about
#### What are we talking about?

CONTRIBUTING.md Outdated

#### What are we talking about

When working on a pull request for patch-hub, you will often re-evaluate something you already committed: fix or refactor an implementation, split a commit into smaller, self-contained pieces, reorder commits for clarity, and more. In these cases, we recommend rewriting the branch history (using interactive rebase git rebase -i and git commit --amend) rather than stacking fix commits on top of your branch.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
When working on a pull request for patch-hub, you will often re-evaluate something you already committed: fix or refactor an implementation, split a commit into smaller, self-contained pieces, reorder commits for clarity, and more. In these cases, we recommend rewriting the branch history (using interactive rebase git rebase -i and git commit --amend) rather than stacking fix commits on top of your branch.
When working on a pull request for patch-hub, you will often re-evaluate something you already committed: fix or refactor an implementation, split a commit into smaller, self-contained pieces, reorder commits for clarity, and more. In these cases, we strongly recommend rewriting the branch history (using interactive rebase git rebase -i and git commit --amend) rather than stacking new commits on top of your branch.

CONTRIBUTING.md Outdated

When working on a pull request for patch-hub, you will often re-evaluate something you already committed: fix or refactor an implementation, split a commit into smaller, self-contained pieces, reorder commits for clarity, and more. In these cases, we recommend rewriting the branch history (using interactive rebase git rebase -i and git commit --amend) rather than stacking fix commits on top of your branch.

#### Why is this important
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
#### Why is this important
#### Why is this important?

CONTRIBUTING.md Outdated

#### Why is this important

Rewriting commits helps ensure the pull request shows only the final, intended changes. This improves reviewability and long-term maintainability by avoiding a noisy trail of intermediate fixes, making it easier for reviewers to understand the final result without tracking every small adjustment.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is a justification for why it improves reviewability but not why it improves long-term maintainability. I think you should also mention the benefits considering the git history, project versioning, etc.

This commit adds a new subsection, “Rewriting Branches”, to the Pull Request Guidelines in the contributing.md file.
The new section explains what branch rewriting is, why it’s essential for contributing to the Patch Hub project, and
links to the official Git documentation for more detailed guidance.

Rewriting branches is a key skill in Patch Hub’s contribution workflow, helping ensure pull requests remain clean,
focused, and easy to review. It also maintains a meaningful Git history, which improves long-term maintainability and
version tracking.

Closes kworkflow#151

Signed-off-by: JGBSouza <joaosouzaaa12@usp.br>
@JGBSouza JGBSouza force-pushed the docs/add_excerpt_rewriting_branches branch from 69aae10 to cfcaade Compare October 18, 2025 20:49
@JGBSouza JGBSouza requested a review from lorenzoberts October 18, 2025 20:50
@JGBSouza
Copy link
Author

Besides that, regarding the commit message, i think it's better for us to start it by directly saying what the commit does: "This commit adds/..". After that, if you want to add a more "abstract" reflection of the commit importance, or anything not so direct, feel free to do it. You can also add the reference to the issue in the commit itself, not only in the PR.

Hi Lorenzo, fixed this pull request and the commit message!

Copy link
Collaborator

@lorenzoberts lorenzoberts left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @JGBSouza. Commit merged into unstable branch. Will close this PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants