I would like to throw a warning in a pre-commit hook but without aborting the commit. However, it seems svn bufferizes the output and only displays it if the check aborts.
Is it possible to output warnings without aborting?
I would like to throw a warning in a pre-commit hook but without aborting the commit. However, it seems svn bufferizes the output and only displays it if the check aborts.
Is it possible to output warnings without aborting?
Warnings can actually be achieved in post-commit hooks by making them fail (with
$? != 0
, just as with pre-commit hooks).So in my case, I made the command I'm using return
1
for errors and2
for warnings, and I call it in both pre- and post-commit hooks.In the pre-commit hook, I have:
while in the post-commit hook, I have:
Thus, errors prevent the commit while warnings only make the post-commit hook error out, which doesn't prevent the commit but still warns the user with the content of
STDERR
.You could send the warnings via email using the mail command.