[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: Retrieving commit information in post-commit hook & hook script s tandard output

From: si <sshnug.si_at_gmail.com>
Date: 2006-01-12 05:03:18 CET

Hi Tejinder,

> svn log --revision HEAD --verbose > CommitInfo.txt
>
> The commit occurs but I don't see the CommitInfo output file.

Perhaps it's related to the "Tip" in:

http://svnbook.red-bean.com/nightly/en/svn.reposadmin.create.html#svn.reposadmin.create.hooks

Or it's also in <repos>/hooks/post-commit.tmpl

# The hook program typically does not inherit the environment of
# its parent process. For example, a common problem is for the
# PATH environment variable to not be set to its usual value, so
# that subprograms fail to launch unless invoked via absolute path.
# If you're having unexpected problems with a hook program, the
# culprit may be unusual (or missing) environment variables.

so try /path/to/svn ... maybe that will sort you out.

> Also, I've noticed that any output sent to standard out (screen) by the
> hooks is not displayed to the user. Is there any way to make it possible to
> write to the standard output?

AFAIK You can use stderr in the pre-commit hook,
from <repos>/hooks/pre-commit.tmpl:

# If the hook program exits with success, the txn is committed; but
# if it exits with failure (non-zero), the txn is aborted, no commit
# takes place, and STDERR is returned to the client. The hook
# program can use the 'svnlook' utility to help it examine the txn.

I believe the other pre-... hooks follow the same behaviour.

peace
si

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Thu Jan 12 05:06:01 2006

This is an archived mail posted to the Subversion Users mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.