8000 add CONTRIBUTING guide by adrianchiris · Pull Request #1071 · vishvananda/netlink · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

add CONTRIBUTING guide #1071

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

adrianchiris
Copy link
Collaborator

define contributing guide with general guidelines.

@adrianchiris
Copy link
Collaborator Author

@aboch lets get this one in. hopefully it will help with PRs format :)

define contributing guide with general guidelines.

Signed-off-by: adrianc <adrianc@nvidia.com>

## General

* One commit per PR.
Copy link
Contributor

Choose a reason for hiding this comment

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

I really have a big issue with this; yes, a PR should not have "fix-up" commits, but I don't see a good reasons for making a single-commit-per-PR a requirement; also see my comment on #1048 (comment)

Commits should be logically grouped (and each commit in a PR should build), but a pull request may contain multiple commits to make them useful.

Copy link
Owner

Choose a reason for hiding this comment

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

As the creator of the initial policy, the thing I care about is making sure the history is linear and every commit can build properly. The easiest way to enforce this is to disallow merge commits and require one commit per pr. I think a series of commits that can be rebased cleanly onto main is also fine although I find that is a bit harder for newer contributors to do well.

Copy link
Collaborator Author
@adrianchiris adrianchiris Apr 3, 2025

Choose a reason for hiding this comment

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

My goal with this PR is to reflect the current policies defined by the maintainers of the repo so we can have a baseline.

personally i usually do a merge commit or squash and merge in other GH repos where im a maintainer.

TBH i see far too often PRs with multiple commits that have really no business getting merged as is.

e.g
a PRs that end up having something of the sort of (each bullet is a commit, stack style bottom to top):

  • forgot to cover some scenario via test
  • fix that lint issue
  • address review comments
  • feat: initial implementaion

Copy link
Contributor

Choose a reason for hiding this comment

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

Right, but that's part of the review process. I have definitely dealt with a good share of contributions in Moby (Docker), runc, and Containerd where the PR has an unclean set of commits ("add foo, fix previous commit, ..."), and for those, part of the review is to come to a good structure for the commits (which could be "these all belong in a single one")

But there's many examples where a carefully crafted set of commits, all part of the related units of work, provide much value. They may be part of a larger unit of work but help describe the change made to provide context, or to separate more mundane changes from the important bits of the work, which can provide value during review, but also when having to revisit a change (blame will provide the correct context). Just picking a random example; opencontainers/runc#3216

Copy link
Collaborator

Choose a reason for hiding this comment

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

As the creator of the initial policy, the thing I care about is making sure the history is linear and every commit can build properly. The easiest way to enforce this is to disallow merge commits and require one commit per pr. I think a series of commits that can be rebased cleanly onto main is also fine although I find that is a bit harder for newer contributors to do well.

Exactly. This is the best way to guarantee each commit is self-contained. CI passes. It can be cleanly ported to other branches. It forces the author to push a finalized, tested change.

@thaJeztah In the past nine years, I very rarely saw a PR with multiple commits here. It's just a non-issue to discuss about, IMO.

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.

4 participants
0