Skip to content
Markus Hastreiter edited this page Mar 23, 2019 · 2 revisions

Here a some examples that show common purposes for RepoCop. They should hopefully make it pretty clear and easy to grab the whole concept.

<!-- Enforce log messages with at least 10 characters -->
<FailInstructionMessage="Log messages require at least 10 characters.">
<LogMessageConditionLogMessageRegExPattern=".{10}"Negate="True" />
</FailInstruction> 
<!-- Allow checkin of bmp and png files only with special tag [override ressource rule] in commit log -->
<FailInstructionMessage="To ensure that ressources of type *.bmp and *.png are not added by accident the tag [override ressource rule] must be included with the commit message.">
<ConditionsType="And">
<LogMessageConditionLogMessageRegExPattern="\[override ressource rule\]"Negate="True" />
<ChangedPathConditionChangedPathRegExPattern=".*\.(png|bmp)"Action="Add" />
</Conditions>
</FailInstruction>
<!-- Locked repo paths -->
<FailInstructionMessage="The path /branches/version_1.1 is locked and may no longer be modified.">
<ChangedPathConditionChangedPathRegExPattern=".*/branches/version_1\.1.*" />
</FailInstruction>
<!-- Send email reminder to user who modified "ImportantFile.txt" with further instructions -->
<MailInstructionFromMailAddress="svn@mydomain.com"ToMailAddresses="#author#@mydomain.com"Subject="ImportantFile.txt has been changed"BodyTemplateFile="ImportantFileChangedMailBody.txt">
<ChangedPathConditionChangedPathRegExPattern=".*/trunk/ImportantFile.txt" /> </MailInstruction>
<!-- Notify project leader about every change -->
<MailInstructionFromMailAddress="#author#@mydomain.com"ToMailAddresses="projectleader@mydomain.com"Subject="Svn ##revision#"Body="#logmessage#"/>

Clone this wiki locally