Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How might I force our developers to enter notes when committing via TortoiseSVN? [duplicate]

I often see a slew of commits, but no notes referencing the tickets... And so I end up going back and reviewing the diff manually. Not necessarily bad, but it would be nice to have notes. Any ideas?

like image 410
Satchel Avatar asked Dec 18 '09 19:12

Satchel


3 Answers

Not TortoiseSVN, but Subversion itself - a setting on the server. You can set up a pre-commit hook that enforces a commit comment. There are also pre-commit hooks that will verify the presence of a reference to an issue tracking system like Jira if you want to go one step further.

like image 153
David M Avatar answered Sep 28 '22 07:09

David M


You can define a pre-commit hook script which rejects all commits with an empty or too short log message.

Here is a post on how to do it.

like image 31
Nadia Alramli Avatar answered Sep 28 '22 06:09

Nadia Alramli


You need to use a pre-commit hook which is a server setting, I have written one for VisualSVN which is basically a batch file -- similar scripts are available for non-windows based SVN Servers.

@echo off
::
:: Stops commits that have empty log messages.
::
@echo off
setlocal

rem Subversion sends through the path to the repository and transaction id
set REPOS=%1
set TXN=%2

rem check for an empty log message
call "C:\program files\visualsvn server\bin\svnlook" log %REPOS% -t %TXN% | findstr . > nul
if %errorlevel% gtr 0 (goto err) else exit 0

:err
echo. 1>&2
echo Your commit has been blocked because you didn't give any log message 1>&2
echo Please write a log message describing the purpose of your changes and 1>&2
echo then try committing again. -- Thank you 1>&2
exit 1
like image 29
Nate Avatar answered Sep 28 '22 06:09

Nate