ONLY 1 JIRA issue per commit. Think about this scenario: a developer performs a Commit for 1 new functionality and 4 bugs. Then, here are the problems:
|
|
To submit code into Gerrit on an unfinished feature, multiple times to bring transparency and get early feedback , refer to "Submitting a Draft Feature" |
The following is based on OPEN-O experiences and multiple references in the open source community.
There are tons of reasons on why it is essentials to write good commit messages. For the sake of keeping things short, here are 3 reasons:
Which Commits would you rather read?
To formulate good commit message focus is these 3 points:
There is always a possibility to change to commit message before the code is merged.
You simply have to enter the command line: git commit --amend
This method is applicable only for the latest change.
As OOM is the installer, it receives merge requests from all ONAP components. It's therefore important to understand from which component it comes and what's the specific changes it comes from.
Therefore, the commit message (on OOM) must follow this form:
[NAME_OF_COMPONENT|DOC|COMMON|GENERIC] Meaningful title (from OOM side)
at least one sentence explaining the change done in this patch, cause and consequences and possibly more of course
Issue-ID: AS_WE_ARE_FORCED_BUT_MEANINGLESS
Change-ID: xxx
Sign-off: xxx
Commit message will be the last stuff that will stay with our code so it must clearly explain the changes, the "why" and the consequences. If it change OOM behavior in any way, documentation must be also updated.
Merge requests which are not following this pattern will not be merged.
Please read the following pages and follow the guidelines for writing commit message contained therein.
As you can see, most of the change is to declare which componentn is impacted by this change
How to Write a Git Commit Message. Very inspiring, I particularly like this sentence What may be a hassle at first soon becomes habit, and eventually a source of pride and productivity for all involved.
OpenStack Git commit Good Practices
Commit Message Good Practices
Writing Good Commit Messages
On Commit Message
https://gerrit.onap.org/r/Documentation/user-upload.html#push_replace (Thanks Geora)