<CommandLineInstruction> element

The <CommandLineInstruction> element is used to call external command line programs, batch files, etc.

When executed as pre-commit hook, the exit code of the called program is checked. If the called program exits with an exit code other than 0 the commit will fail. But there are programs that return exit codes other than 0 even if everythings find. Therefore, the expected exit code (the exit code with which the commit is ok) can be specified via the ExpectedExitCode attribute.
When executed as post-commit hook, the exit code of the called program is ignored.

Attributes

Attribute name Status Default Description
FileName mandatory The path and filename of the called program. Note that it is important to specify the full path as hooks (at least in subversion) can't use environment variables like %PATH%.
Arguments optional These arguments are handed to the called program. If you need quote characters use &quot; instead (e.g. for -m "info" you would write the following Arguments attribute: -Arguments="-m &quot;info&quot;")
ExpectedExitCode optional 0 If the program exits with an exit code other than this exit code the commit will fail (only applies to pre-commit).
TimeoutInMilliseconds optional 60000 A timeout used when executing to called program. Use 0 for infinite timeout.
NewLineReplacement optional "" A character or string which will replace Environment.NewLine in the executed command line.

Example

  <!-- Add commit to ReviewBoard -->

Last edited Jan 12, 2014 at 2:07 PM by markushastreiter, version 2

Comments

No comments yet.