Running NArrange from SVN pre-commit hook

2019-08-20 11:18发布

问题:

I am trying to execute NArrange from SVN pre-commit hook using following command:

"C:\Fullpath\narrange-console.exe" "C:\SolutionDir\SolutionFile.sln" /b /t

It returns with an Error: "The hook script returned an error: "

Any one any at rescue?

EDIT: This hook are tortoisesvn client hooks.

回答1:

The pre-commit hook is evaluated on the repository server; not on the client. And pre-commit hooks can't change what is to be committed. (They can only deny a commit if it is not valid for some rules).

You could look at tortoisesvn client hooks, or at a post commit that does a cleanup commit when a file changes. (But make sure you don't get in an endless loop :))