Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
git:kamailio-repository [2008/11/20 14:51] miconda created |
git:kamailio-repository [2010/03/31 18:38] (current) miconda |
||
---|---|---|---|
Line 1: | Line 1: | ||
====== Hacking Kamailio with Git ====== | ====== Hacking Kamailio with Git ====== | ||
+ | ===== Development version ===== | ||
+ | |||
+ | Since version 3.0.0, the development version of Kamailio is the master branch of sip-router.org GIT repository. Therefore is the same source code for Kamailio (OpenSER) and SIP Express Router (SER). | ||
+ | |||
+ | Fetch the GIT master branch as usual: | ||
+ | |||
+ | < | ||
+ | git clone --depth 1 git:// | ||
+ | cd kamailio | ||
+ | </ | ||
+ | |||
+ | If you have a developer account, then you can use: | ||
+ | |||
+ | < | ||
+ | git clone --depth 1 ssh:// | ||
+ | cd kamailio | ||
+ | </ | ||
+ | |||
+ | To compile and install the Kamailio flavour, do: | ||
+ | |||
+ | < | ||
+ | make FLAVOUR=kamailio cfg | ||
+ | make all | ||
+ | make install | ||
+ | </ | ||
+ | |||
+ | ===== Kamailio 3.0.x ===== | ||
+ | |||
+ | The version 3.0.x resides as branch **kamailio_3.0** in sip-router.org GIT repository. | ||
+ | |||
+ | Fetch it via: | ||
+ | |||
+ | < | ||
+ | git clone --depth 1 git:// | ||
+ | cd kamailio-3.0 | ||
+ | git checkout -b kamailio_3.0 origin/ | ||
+ | </ | ||
+ | |||
+ | If you have a developer account, then you can use: | ||
+ | |||
+ | < | ||
+ | git clone --depth 1 ssh:// | ||
+ | cd kamailio-3.0 | ||
+ | git checkout -b kamailio_3.0 origin/ | ||
+ | </ | ||
+ | |||
+ | Installation is straightforward, | ||
+ | |||
+ | < | ||
+ | make all | ||
+ | make install | ||
+ | </ | ||
+ | |||
+ | ===== Backport patches to Kamailio 3.0.x ===== | ||
+ | |||
+ | Fetch the development (master) branch with your developer account. | ||
+ | |||
+ | Update the code, then do the local commit. Note that small commits are preferred (more smaller commits are better then a huge commit touching multiple modules or | ||
+ | adding multiple features or fixes). Please make sure you read first the [[devel: | ||
+ | |||
+ | < | ||
+ | git add files_that_you changes # use git status or git diff to see them | ||
+ | git commit | ||
+ | </ | ||
+ | |||
+ | Upload to remote repository: | ||
+ | |||
+ | < | ||
+ | git push origin master: | ||
+ | </ | ||
+ | |||
+ | If git push fails it usually means someone updated master in the meantime and you should rebase on the latest version and retry the push: | ||
+ | |||
+ | < | ||
+ | git fetch origin | ||
+ | git rebase origin/ | ||
+ | git push origin master: | ||
+ | </ | ||
+ | |||
+ | |||
+ | |||
+ | Fetch in your kamailio 3.0 branch, in case you have two directories (otherwise, you can just check out the kamailio_3.0 branch): | ||
+ | |||
+ | < | ||
+ | cd / | ||
+ | git checkout kamailio-3.0 | ||
+ | git pull --rebase origin kamailio-3.0 | ||
+ | </ | ||
+ | |||
+ | Use cherry pick to get the commit from master applied to kamailio_3.0 branch: | ||
+ | |||
+ | < | ||
+ | git cherry-pick -x [commit_to_master_hash_id] | ||
+ | </ | ||
+ | |||
+ | For example: | ||
+ | |||
+ | < | ||
+ | git cherry-pick -x 7b8b6f647365655afa210f5e95baef06398ef612 | ||
+ | </ | ||
+ | |||
+ | A quick way to check for the master hash id is: | ||
+ | |||
+ | < | ||
+ | git fetch origin # if you are using a different directory for kamilio-3.0 | ||
+ | git log --oneline origin/ | ||
+ | </ | ||
+ | |||
+ | Then upload to remote repository in kamailio_3.0 branch: | ||
+ | |||
+ | < | ||
+ | git push origin kamailio_3.0: | ||
+ | </ | ||
+ | |||
+ | If push fails, rebase and try again: | ||
+ | |||
+ | < | ||
+ | git fetch origin | ||
+ | git checkout kamailio_3.0 | ||
+ | git rebase origin/ | ||
+ | git push origin kamailio_3.0: | ||
+ | </ |