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
Copy file name to clipboardExpand all lines: CONTRIBUTING.md
+72-2Lines changed: 72 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -791,7 +791,50 @@ to `memset()` structures with zero. Non-zero `NULL` is for retro computing.
791
791
792
792
## Git Commit Style
793
793
794
-
Clear and descriptive commit messages are crucial for maintaining a transparent history of changes and for facilitating effective debugging and tracking. Please adhere to the guidelines outlined in [How to Write a Git Commit Message](http://chris.beams.io/posts/git-commit/).
794
+
Effective version control is critical to modern software development.
795
+
Git's powerful features—such as granular commits, branching,
796
+
and a versatile staging area—offer unparalleled flexibility.
797
+
However, this flexibility can sometimes lead to disorganized commit histories and
798
+
merge conflicts if not managed with clear, consistent practices.
799
+
800
+
By committing often, writing clear messages, and adhering to a common workflow,
801
+
developers can not only reduce the potential for errors but also simplify collaboration and future maintenance.
802
+
We encourage every team to tailor these best practices to their specific needs while striving
803
+
for a shared standard that promotes efficiency and code quality.
804
+
805
+
Below are the detailed guidelines that build on these principles.
806
+
* Group Related Changes Together
807
+
Each commit should encapsulate a single, coherent change.
808
+
e.g., if you are addressing two separate bugs, create two distinct commits.
809
+
This approach produces focused, small commits that simplify understanding, enable quick rollbacks,
810
+
and foster efficient peer reviews.
811
+
By taking advantage of Git’s staging area and selective file staging,
812
+
you can craft granular commits that make collaboration smoother and more transparent.
813
+
* Commit Frequently
814
+
Making commits often ensures that your changes remain concise and logically grouped.
815
+
Frequent commits not only help maintain a clean history but also allow you to share your progress with your teammates regularly.
816
+
This regular sharing keeps everyone in sync,
817
+
minimizes merge conflicts, and promotes a collaborative environment where integration happens seamlessly.
818
+
* Avoid Committing Work in Progress
819
+
Only commit code when a logical component is in a stable, ready-to-integrate state.
820
+
Break your feature's development into manageable segments that reach a functional milestone quickly,
821
+
so you can commit regularly without compromising quality.
822
+
If you feel the urge to commit merely to clear your working directory for actions like switching branches or pulling changes,
823
+
use Git's stash feature instead.
824
+
This practice helps maintain a stable repository and ensures that your team reviews well-tested, coherent code.
825
+
* Test Your Code Before Committing
826
+
Before committing, ensure that your code has been thoroughly tested.
827
+
Rather than assuming your changes are ready, run comprehensive tests to confirm they work as intended without unintended side effects.
828
+
Testing is especially critical when sharing your code with others,
829
+
as it maintains the overall stability of the project and builds trust among collaborators.
830
+
* Utilize Branches for Parallel Development
831
+
Branches are a powerful tool that enables developers to isolate different lines of work—whether you are developing new features,
832
+
fixing bugs, or exploring innovative ideas.
833
+
By using branches extensively, you can work on your tasks independently and merge only after careful review and testing.
834
+
This not only keeps the main branch stable but also encourages collaborative code reviews and a more organized integration process.
835
+
836
+
Clear and descriptive commit messages are crucial for maintaining a transparent history of changes and for facilitating effective debugging and tracking.
837
+
Please adhere to the guidelines outlined in [How to Write a Git Commit Message](http://chris.beams.io/posts/git-commit/).
795
838
1. Separate the subject from the body with a blank line.
796
839
2. Limit the subject line to 50 characters.
797
840
3. Capitalize the subject line.
@@ -801,7 +844,6 @@ Clear and descriptive commit messages are crucial for maintaining a transparent
801
844
7. Use the body to explain what and why, not how.
802
845
803
846
An example (derived from Chris' blog post) looks like the following:
0 commit comments