The Wiert Corner – irregular stream of stuff

Jeroen W. Pluimers on .NET, C#, Delphi, databases, and personal interests

  • My badges

  • Twitter Updates

  • My Flickr Stream

  • Pages

  • All categories

  • Enter your email address to subscribe to this blog and receive notifications of new posts by email.

    Join 1,860 other subscribers

Good example for open source guidelines to contributors: liburing/CONTRIBUTING.md at master · axboe/liburing · GitHub

Posted by jpluimers on 2024/11/07

This one is clear and concise. [Wayback/Archive] liburing/CONTRIBUTING.md at master · axboe/liburing · GitHub of which some highlights:

The main reasons for the rules are:

  1. Keep the code consistent
  2. Keep the git repository consistent
  3. Maintain bisectability

No fixup commits! Sometimes people post a change and errors are pointed out in the commit, and the author then does a followup fix for that error. This isn’t acceptable, please squash fixup commits into the commit that introduced the problem in the first place. This is done by amending the fix into the original commit that caused the issue. You can do that with git rebase -i and arrange the commit order such that the fixup is right after the original commit, and then use ‘s‘ (for squash) to squash the fixup into the original commit. Don’t forget to edit the commit message while doing that, as git will combine the two commit messages into one. Or you can do it manually. Once done, force push your rewritten git history. See reasons 1-3 in the introduction series for why that is.

A good commit explains the WHY of a commit – explain the reason for this commit to exist. Don’t explain what the code in commit does, that should be readily apparent from just reading the code. liburing commits follow the following format:

Title

Body of commit

Signed-off-by: My Identity <my@email.com>

That is, a descriptive title on the first line, then an empty line, then the body of the commit message, then an empty line, and finally an SOB tag. The signed-off-by exists to provide proof of origin, see the DCO.

Via the thread starting at [Wayback/Archive] Jens Axboe: “Having worked on the kernel fo…” – Fosstodon

Having worked on the kernel for decades, and imposing a lot of the same code/git hygiene for liburing, there can be a disconnect for contributors on what is expected of a commit and commit message, and what series of commits should look like. I attempted to provide a basic guideline here:
github.com/axboe/liburing/blob…

--jeroen

Leave a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.