Commiting changes to Subversion
ChangeLog and commit descriptions
This small text is for explaining everybody WHY is important to send a “fully formatted” SVN message in commits
a) It's easy to read for everybody because all messages have the same format: Date, name of coder, email of coder. Filename and comments. Let's see an example:
2006-07-20 Sancho Lerena <[email protected]> * babel_dbdata.sql: Fixed problems with group all Icon name. * include/setup.php: Fixed problems with background filename combo, and fixed problems in left/right combo selector.
b) If everybody uses the same format, it helps to make readable changes and reviews in the future.easy,
c) You simply can “cut & paste” and break lines in column 79, you don't need to install Emacs or another tool (but Emacs help too much!).
d) Remember to update ChangeLog before committing, and simply cut and paste from ChangeLog to commit message. A ChangeLog file should be present on the “root” directory of each package, or subproject.
e) Doing the ChangeLog will not take more than 10 minutes. You can see what have you changed using graphical tools like meld (under *NIX) or executing
f) Describe WHAT have you changed, not WHY.
g) It's a good idea (more easy to read, more easy to commit, more easy to track, and more clean) to make a single commit than to do a several mini-commits of one single file. Also take less time to you.
Merging from trunk to Branches
To merge code from lastest Trunk code to your branch, you will use svn merge command. It's very easy, but in documentation there are some confussion descriptions, and it's not very well explained. So we will use a practical example, suppose that:
You have a trunk main repository (updated) at
And you have a branch for your subproyects at
And inside that repository you have many directories, like
./pandora_console ./pandora_server ./pandora_agents
And you want to merge latest code from trunk repository to your local one, but only for pandora_console code.
svn merge --dry-run /datos/pandora/branches/pandora_1.2/[email protected] \ /datos/pandora/trunk/[email protected] \ /datos/pandora/branches/pandora_1.2/pandora_console
“Merge latest (HEAD) code from my branch and latest code from trunk, and write onto my branch.
–dry-run is an option to “do not write, only see me the results on console”. Useful for test the first execution if youre not very sure of what are you doing.
VERY IMPORTANT: Please be sure to commit your local branches _BEFORE_ trying to MERGE anything, because you can LOST data due the merge process. If you have commited it, if you have any problem always can do an rm -Rf * and update from SVN.