Difference between revisions of "Creating a Samba patch series"

From SambaWiki
Line 7: Line 7:
 
This page is not meant to be a technical overview about using git, there are already [https://git-scm.com/docs plenty of resources] for learning to use git. It's expected when you reach this page that you already know these concepts.
 
This page is not meant to be a technical overview about using git, there are already [https://git-scm.com/docs plenty of resources] for learning to use git. It's expected when you reach this page that you already know these concepts.
   
== What a commit should include ==
+
= What a commit should include =
   
 
Each git commit should be succinct and only do one thing.
 
Each git commit should be succinct and only do one thing.
   
=== Bisectability ===
+
== Bisectability ==
   
 
The problem with merge requests is that the '''Changes''' view shows a complete product, without intermediate stages. In Samba, we also care about the history when getting to the final product. Small succinct commits make it possible to run [https://git-scm.com/docs/git-bisect git bisect] on the history, allowing us to find commits that introduce bugs.
 
The problem with merge requests is that the '''Changes''' view shows a complete product, without intermediate stages. In Samba, we also care about the history when getting to the final product. Small succinct commits make it possible to run [https://git-scm.com/docs/git-bisect git bisect] on the history, allowing us to find commits that introduce bugs.
Line 17: Line 17:
 
Sometimes developers will argue that reviewers should take the end result as a whole, and evaluate a patch series on it's functionality. We recognize the effort put into preparing patches for Samba, but requests cannot be accepted that are not bisectable.
 
Sometimes developers will argue that reviewers should take the end result as a whole, and evaluate a patch series on it's functionality. We recognize the effort put into preparing patches for Samba, but requests cannot be accepted that are not bisectable.
   
== Examples ==
+
= Examples =
   
 
=== What not to do ===
 
=== What not to do ===

Revision as of 19:00, 15 June 2020

Introduction

When contributing to Samba, there are quality expectations that need to be met in order for your patches to be accepted. Please review these guidelines before writing your first commits, otherwise you may need to rebase your patches.

What this page is not

This page is not meant to be a technical overview about using git, there are already plenty of resources for learning to use git. It's expected when you reach this page that you already know these concepts.

What a commit should include

Each git commit should be succinct and only do one thing.

Bisectability

The problem with merge requests is that the Changes view shows a complete product, without intermediate stages. In Samba, we also care about the history when getting to the final product. Small succinct commits make it possible to run git bisect on the history, allowing us to find commits that introduce bugs.

Sometimes developers will argue that reviewers should take the end result as a whole, and evaluate a patch series on it's functionality. We recognize the effort put into preparing patches for Samba, but requests cannot be accepted that are not bisectable.

Examples

What not to do

Here is an actual example from an open source project (identifying information has been removed), of a poorly created merge request:

Github mr 1.png

Github mr 2.png

This request contains 47 commits, the merge request title does not explain what the code change is doing, and the final result is a single line code change!