Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I’ve just spent several days procrastinating about exactly this question. There are third party products available and plenty of PERL and Python scripts but I wanted something simple and a language I was familiar with so ended up just writing hooks in a C# console app. It’s very straight forward:</p> <pre><code>public void Main(string[] args) { string repositories = args[0]; string transaction = args[1]; var processStartInfo = new ProcessStartInfo { FileName = "svnlook.exe", UseShellExecute = false, CreateNoWindow = true, RedirectStandardOutput = true, RedirectStandardError = true, Arguments = String.Format("log -t \"{0}\" \"{1}\"", transaction, repositories) }; var p = Process.Start(processStartInfo); var s = p.StandardOutput.ReadToEnd(); p.WaitForExit(); if (s == string.Empty) { Console.Error.WriteLine("Message must be provided"); Environment.Exit(1); } Environment.Exit(0); } </code></pre> <p>You can then invoke this on pre commit by adding a pre-commit.cmd file to the hooks folder of the repo with the following line:</p> <pre><code>[path]\PreCommit.exe %1 %2 </code></pre> <p>You may consider this overkill but ultimately it’s only a few minutes of coding. What’s more, you get the advantage of the .NET language suite which IMHO is far preferable to the alternatives. I’ll expand my hooks out significantly and write appropriate tests against them as well – bit hard to do this with a DOS batch file!</p> <p>BTW, the code has been adapted from <a href="http://irwinj.blogspot.com/2008/04/simple-subversion-trigger.html" rel="noreferrer">this post</a>.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload