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

Re: How to get the client hostname while user committing the code to the repository?

From: Campbell Allan <campbell.allan_at_sword-ciboodle.com>
Date: Fri, 6 Aug 2010 18:21:16 +0100

On Wednesday 28 Jul 2010, ram kumar wrote:
> Hi,
>
> 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.
>
> Prototype is working fine 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
>
> Regards,
> Ramkumar
>

If this is to do with reporting a failure then that can be done by writing to
stderr in a precommit hook. If you want something interactive then I don't
believe that is easily possible. I did a quick test with my setup, which does
a commit over https, the environment that the pre-commit script runs in is
very limited. Subversion only passes enough information to the script to
identify the transaction. The rest of the information can be obtained by
calling out to svnlook.

The best I could suggest is modifying the subversion server code to pass
through to the script the address as an environment variable. Even this might
not be possible if apache does not pass through the client address to the
subversion modules.

> > Hi,
> >
> >
> >
> >
> >
> >
> >
> > I need your help.
> >
> >
> >
> >
> >
> >
> >
> > I need the client host information in either pre or post-commit trigger.
>
> Good luck with that!! If you're using a single protocol of access, such as
> ssh+svn or HTTPS, it's conceivable that you could adopt a wrapper to do
> something clever and deduce the hostname. But it seems awkward.
>
>
>
> Why do you want this?

-- 
__________________________________________________________________________________
Sword Ciboodle is the trading name of ciboodle Limited (a company 
registered in Scotland with registered number SC143434 and whose 
registered office is at India of Inchinnan, Renfrewshire, UK, 
PA4 9LH) which is part of the Sword Group of companies.
This email (and any attachments) is intended for the named
recipient(s) and is private and confidential. If it is not for you, 
please inform us and then delete it. If you are not the intended 
recipient(s), the use, disclosure, copying or distribution of any 
information contained within this email is prohibited. Messages to 
and from us may be monitored. If the content is not about the 
business of the Sword Group then the message is neither from nor 
sanctioned by us.
Internet communications are not secure. You should scan this
message and any attachments for viruses. Under no circumstances
do we accept liability for any loss or damage which may result from
your receipt of this email or any attachment.
__________________________________________________________________________________
Received on 2010-08-06 19:24:38 CEST

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.