Zen's Blog » Source Control

Category / Source Control

Merge is Release August 31, 2011 at 22:28

“A small part of me dies on every release”

A colleague wrote the above statement on the white board in the war-room today after working close to half a day with an internal release of source code meant for the other dev-teams working on the same project. When it takes almost four hours to do an internal release, a manual process that often goes wrong and has to be mended or redone, then it is something terribly wrong with the procedure.

Release should be as easy as Merge

Any new feature should be developed on a separate feature branch. Once the code is in place, it compiles, all unit- and function-tests pass, no lint warnings, no doxygen warnings, no code duplication and the code is peer reviewed; then you merge back to main/trunk. The merge should be close to trivial since the application you are writing are well partitioned, abide to the SOLID principles. (especially to OCP – open closed principle**) and each feature is small and distinctive enough so that you finish within a few days.

We do all that, or pretty close to it. The problem is not our coding practice –at least not in this instance. The problem is the version control system and the release process. I’m too embarrassed about the actual system in place so I won’t go into details. Lets just conclude that it is awful.

If your release process is any more complicated than a merge, than you are doing something wrong.

** If you are not familiar with the SOLID-principles or specifically the Open Closed Principle, please read this blog-post. Also stay tuned; future posts will discuss the individual principles behind the acronym.

SVN Windows: allow edit of commit logs January 16, 2010 at 00:34

By default, SVN does not allow you to change commit messages. To enable that some times good some times bad feature, create a file named pre-revprop-change.bat and place it in the /repos/hooks folder of your svn central repo installation.

 Winbatch | 
 
 copy code |
?

01
@ECHO OFF
02
:: Set all parameters. Even though most are not used, in case you want to add
03
:: changes that allow, for example, editing of the author or addition of log messages.
04
set repository=%1
05
set revision=%2
06
set userName=%3
07
set propertyName=%4
08
set action=%5
09
 
10
:: Only allow the log message to be changed, but not author, etc.
11
if /I not “%propertyName%” == “svn:log” goto ERROR_PROPNAME
12
 
13
:: Only allow modification of a log message, not addition or deletion.
14
if /I not “%action%” == “M” goto ERROR_ACTION
15
 
16
:: Make sure that the new svn:log message is not empty.
17
set bIsEmpty=true
18
for /f “tokens=*%%g in (‘find /V “”‘) do (
19
set bIsEmpty=false
20
)
21
if%bIsEmpty%” == “truegoto ERROR_EMPTY
22
 
23
goto :eof
24
 
25
:ERROR_EMPTY
26
echo Empty svn:log messages are not allowed. >&2
27
goto ERROR_EXIT
28
 
29
:ERROR_PROPNAME
30
echo Only changes to svn:log messages are allowed. >&2
31
goto ERROR_EXIT
32
 
33
:ERROR_ACTION
34
echo Only modifications to svn:log revision properties are allowed. >&2
35
goto ERROR_EXIT
36
 
37
:ERROR_EXIT
38
exit /b 1