This shows you the differences between two versions of the page.
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:// | ||
+ | |||
+ | A read-only mirror is maintained at: | ||
+ | |||
+ | * git.kamailio.org (still accessible via git.sip-router.org) - web interface: | ||
+ | * http:// | ||
===== Cloning GIT Repository ===== | ===== Cloning GIT Repository ===== | ||
Line 113: | Line 124: | ||
* module_name: | * module_name: | ||
* 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 |
< | < | ||
- | 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:// | * http:// | ||
+ | ==== 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, | ||
+ | * 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 ' | ||
===== Generic Guidelines ===== | ===== Generic Guidelines ===== | ||
Line 295: | Line 309: | ||
< | < | ||
git push origin :< | git push origin :< | ||
+ | </ | ||
+ | |||
+ | As of Git v1.7.0, a remote branch can be deleted using: | ||
+ | |||
+ | < | ||
+ | git push origin --delete < | ||
+ | </ | ||
+ | |||
+ | ==== Revert already pushed commit ==== | ||
+ | |||
+ | This will produce a commit reverting the previous commit < | ||
+ | |||
+ | < | ||
+ | git revert < | ||
+ | git push origin | ||
+ | </ | ||
+ | |||
+ | ==== Rename and commit file ==== | ||
+ | |||
+ | Create minimal commit when renaming file | ||
+ | |||
+ | < | ||
+ | git mv module.c module_mod.c | ||
+ | git commit -m '...: renamed module file to match recommended pattern' | ||
</ | </ |