subversion-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ryan Schmidt <subversion-20...@ryandesign.com>
Subject Re: How to get the client hostname while user committing the code to the repository?
Date Wed, 28 Jul 2010 14:27:59 GMT
On Jul 27, 2010, at 23:30, ram kumar wrote:

> We are using http protocal. Please find the server and client details below. We have
to popup some window on the client machine either in pre or post commit operation.

Does this mean there is already some other program installed on every client machine watching
for incoming connections of some kind, waiting to display messages to the user? And you want
to interact with that program from the hook script?

> Prototype is working fine

What prototype?

> so need to know how to get the client ip adress or hostnmae in pre/post commit trigger.
>  
> SVN Server: Linux
> SVN Clients: Windows XP

Subversion does not make the client IP address or hostname available to you in the pre- or
post-commit hook scripts.


You could possibly write your own hook triggering method, and bypass Subversion's, using a
strategy like the one I employ in my svnhookdispatcher script:

http://www.ryandesign.com/svnhookdispatcher/

(I read the Apache log, parse out the details, and call some scripts; you could additionally
parse the client IP out of the log and send it along to the scripts.)


Or you could consider a communications method that does not rely on knowing the client IP.
For example, you already know the committer's username. If the committer also has an email
address that can be computed or looked up based on that username, you could send the committer
an email with whatever you wanted to tell them. Or if they are running an instant messaging
client like AIM or ICQ or Jabber and you can discover their instant messaging username, you
could send them an instant message. Or if you have a Twitter account for commits you could
post whatever information to the Twitter account and users could read it with a Twitter client.
Or you could post the information to a web site in an RSS-compatible format and users could
read it using an RSS client. There are many options available (probably more than the ones
I've mentioned here).



Mime
View raw message