Menu

Error: Commit blocked by pre-commit hook...

Help
E. Smith
2009-08-27
2013-05-01
  • E. Smith

    E. Smith - 2009-08-27

    This is a new SubversionNotify 2.0.10 setup. I set things as best I could in the .cfg file and followed the very simple install instructions linked to from subversionotify.com.

    My commits fail with this message in TortoiseSVN's message box:

    Commit failed (details follow):
    Commit blocked by pre-commit hook (exit code 128) with no output.

    I expect it’s just something in my SubversionNotify.cfg file, which I've copied below (with identifying info redacted). Any ideas?

    <?xml version="1.0" standalone="yes"?>
    <subversionNotifyConfig xmlns="http://www.mckechney.com/SubversionNotifyConfig.xsd" LoggingLevel="DEBUG" MaximumEMailSizeInMb="5" MaximumEmailSubjectChars="255">
        <!-- Basic configuration of where to locate the SVN executables -->
        <SVNConfig ExePath="C:\Program Files\Subversion\bin\svnlook.exe" />
       
        <!-- Configure your mail server. Needed for e-mail notifications -->
        <MailServer Name="10.0.0.253" Username="redacted" Password="redacted" FromAddress="redacted"/>
       
        <!-- To integrate with item tracking applications (bugs, tasks, etc) register the handler for it here -->
        <ItemTrackerRegistration>
            <Registration ElementName="QualityCenterConfig" AssemblyName="SubversionNotify.Integration.QualityCenter.dll"/>
            <Registration ElementName="BugzillaConfig" AssemblyName="SubversionNotify.Integration.Bugzilla.dll"/>
        </ItemTrackerRegistration>

        <!-- Register repositories and repo paths to be controlled in one of these sections. -->
        <RepoPathConfig ControlledPaths="/" ControlledRepos="C:\shared\svnrepo_junk\&quot; ExcludeFromPrecedenceFilter="true">

            <!-- In case you want to, you can add a default log message that will get added if no other message is included by the user -->
            <DefaultLogMessage Text="#user# has decided not to add a log message. Don't worry, severe punishment will be administered in short order."/>

            <!-- If you registered item tracker handler above, this is where you add them. Remember, the handler must implement the IItemTracker interface
                    as specified in SubversionNotify.Integration.ItemTracking.dll -->
            <ItemTrackers>
                <BugzillaConfig XmlReturnURL="http://redacted/show_bug.cgi?id={0}&amp;ctype=xml"
                            ItemLinkURL="http://redacted/{0}"
                        ItemFindRegex="\[b?u?g? ?#?([0-9]+(?:\s*,?\s*[0-9]+)*)\]" >
            <!--        <AllowedProducts>
                        <AllowedProduct Name="ProductOne"/>
                    </AllowedProducts>
                    <DisallowedStatuses>
                        <DisallowedStatus Name="CLOSED" RepoPathException="Test" UserException="mmckechney,user2"/>
                        <DisallowedStatus Name="RESOLVED" RepoPathException=""/>
                    </DisallowedStatuses>
                    <LockedItems>
                        <Item ItemId="1000"/>
                        <Item ItemId="1002"/>
                        <Item ItemId="1002"/>
                    </LockedItems> -->
                </BugzillaConfig>
            </ItemTrackers>

            <!-- <execute application="pathtwo.bat" commandline="#revision# #name# #controlledpaths#"/> -->
        </RepoPathConfig>

        <!-- An example of a second, less controlled path-->
        <RepoPathConfig ControlledPaths="/testing">
            <MailTo EmailAddress="redacted" EMailGroupName="Developers,Managers"  EMailType="HTML" />
            <DefaultLogMessage Text="#user# has decided not to add a log message. Don't worry, severe punishment will be administered in short order."/>
            <CommitRequirements FailureMessage="Please add a commit message.">
                <CommitRequirement Description="Any Text" Regex="\w"/>
            </CommitRequirements>
        </RepoPathConfig>

        <!-- If there are paths you want to lock against any changes, you can control that from here-->
        <!-- <LockedPaths>
            <LockedPath RepoPath="/Retired" ControlledRepos="C:\MyRepo"/>
            <LockedPath RepoPath="/ReallyRetired"/>
        </LockedPaths> -->

        <!-- Implementing the pre-prop-change hook, this enforces that the changed message meets you standards -->
        <!-- <PrePropChangeRequirements FailureMessage="A revision comment may only be changed if it includes a Change Request number. Please add [CR ###] to the changed message.">
            <PrePropChangeRequirement Description="Bug Number" Regex="\[c?r? ?#?([0-9]+(?:\s*,?\s*[0-9]+)*)\]" IsBugMatch="true"/>
        </PrePropChangeRequirements> -->

        <PreCommitFailureMessage>
            <MailTo EMailAddress="redacted" CustomSubjectFormat="[SVN Precommit Failure] #user# :: #commitMessage#" />
        </PreCommitFailureMessage>
        <!-- One or more of these, you can set up re-usable distribution lists.
                The Name attribute value is what you use as the EMailGroup value up in the MailTo element-->
        <!-- <EMailGroup Name="Developers">
            <EMail Address="email1@mydomain.com" />
            <EMail Address="email2@mydomain.com" />
        </EMailGroup>
        <EMailGroup Name="Managers">
            <EMail Address="email3@mydomain.com" />
            <EMail Address="email4@mydomain.com" />
        </EMailGroup> -->

    </subversionNotifyConfig>

     
    • E. Smith

      E. Smith - 2009-08-27

      Also note that no .log file gets created in my "c:\subversionnotify\&quot; directory. So perhaps subversionnotify.exe is not getting called? The path to it in each of my hooks\ batch files have been changed so they are correct for my chosen installation directory.

       
      • Bastian Schmidt

        Bastian Schmidt - 2009-08-28

        Could you post the content of your batch file/s?
        What happens if you execute subversionnotify.exe via cmd?

         
    • E. Smith

      E. Smith - 2009-08-28

      When I run subversionnotify.exe via com.com, I get

      SubversionNotify.exe - Application Error
      The application failed to initialize properly (0xc0000135). Click on OK to terminate the application.
      <OK>

      I hadn't reported that originally as I thought it just had to be run with appropriate args and didn't behave well otherwise. I was probably wrong.

      Here are my hooks\ batch files:

      pre-commit.bat:
      c:\subversionnotify\SubversionNotify.exe %1 %2 -pre

      post-commit.bat:
      set REPOS=%1
      set REV=%2
      c:\subversionnotify\SubversionNotify.exe %REPOS% %REV% -post

      pre-revprop-change.bat:
      "c:\subversionnotify\SubversionNotify.exe" %1 %2 %3 %4 %5  -preprop

       
    • E. Smith

      E. Smith - 2009-09-07

      Thanks, batzendev. Installing the .NET 2.0 runtime got me past that problem.

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.