User Tools

Site Tools


devel:git-commit-guidelines

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Next revision Both sides next revision
devel:git-commit-guidelines [2014/12/15 13:53]
miconda [Read-Only Cloning of GIT Repository]
devel:git-commit-guidelines [2016/11/14 22:22]
mslehto [Rename and commit file]
Line 1: Line 1:
 ====== GIT Commit Guidelines ====== ====== GIT Commit Guidelines ======
 +
 +===== GIT Repository Location =====
 +
 +Starting with December 15, 2014, the main GIT repository of Kamailio project is hosted on Github at:
 +
 +  * https://github.com/kamailio/kamailio
 +
 +A read-only mirror is maintained at:
 +
 +  * git.kamailio.org (still accessible via git.sip-router.org) - web interface:
 +    * http://git.kamailio.org
  
 ===== Cloning GIT Repository ===== ===== Cloning GIT Repository =====
Line 113: Line 124:
   * module_name: support for foo   * module_name: support for foo
   * lib_name: critical bug fix   * lib_name: critical bug fix
- 
-If the module_name is duplicated, one in modules_k and one in modules_s, add (k) or (s), depending where the changes was done, for example: 
-  * auth_db(k): fixed typo in comment 
-  * auth_db(s): fixed typo in comment 
  
 Examples of commit messages: Examples of commit messages:
  
-  * change to usrloc module from modules_k+  * change to usrloc module from modules
 <code> <code>
-usrloc(s): fixed name conflict+usrloc: fixed name conflict
  
 - destroy_avps() renamed to reg_destroy_avps() to avoid conflicts - destroy_avps() renamed to reg_destroy_avps() to avoid conflicts
Line 145: Line 152:
   * http://www.tpope.net/node/106   * http://www.tpope.net/node/106
  
 +==== Content of the Commit Message ====
 +
 +    * the message must be addressed for humans, using common sense language. All commit messages are part of the ChangeLog file for each release and that file is read by sysadmins and other non-developer people 
 +    * the message must be strictly related to the changes in the C code (e.g., don't give instructions what another developer must do with your patch)
 +    * credits to persons or companies that helped in the context of the commit are allowed and it is fair to be added whenever is the case. The place is at the end of the commit message (or end of the part describing the related change)
 +    * don't use slang and don't abuse using abbreviations, especially when it is not an official abbreviation
 +    * don't use system or tools commands to express the changes of the commit. They can be given as an example in the detailed message to show how the changes were done, but text explanation must be first. E.g., if you renamed a function, don't use as commit message 's/oldfunc/newfunc/'.
 ===== Generic Guidelines ===== ===== Generic Guidelines =====
  
Line 295: Line 309:
 <code> <code>
 git push origin :<branchName> git push origin :<branchName>
 +</code>
 +
 +As of Git v1.7.0, a remote branch can be deleted using:
 +
 +<code>
 +git push origin --delete <branchName>
 +</code>
 +
 +==== Revert already pushed commit ====
 +
 +This will produce a commit reverting the previous commit <hash>
 +
 +<code>
 +git revert <hash>
 +git push origin
 +</code>
 +
 +==== Rename and commit file ====
 +
 +Create minimal commit when renaming file
 +
 +<code>
 +git mv module.c module_mod.c
 +git commit -m '...: renamed module file to match recommended pattern' module.c module_mod.c
 </code> </code>
devel/git-commit-guidelines.txt ยท Last modified: 2018/10/24 22:33 by henningw