You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by Gloria <st...@comcast.net> on 2006/05/05 17:10:17 UTC

Interactive pre-commit hook script?

Hi all,

I am currently implementing some complex code checking conditions 
specific to our application.

I was hoping to prompt for and read developer responses directly in the 
pre-commit script, but this does not seem to work, although SVNLOOK 
seems to be able to prompt and take interative user input.

My question is, why can't the pre-commit script itself run 
interactively? To get interactive responses, do I need to take control 
of  STDIN, STDOUT, STDERR?

I was expecting standard shell script behavior from pre-commit, but this 
is not what I am seeing.

Thank you in advance,
Gloria


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

Re: Interactive pre-commit hook script?

Posted by Ryan Schmidt <su...@ryandesign.com>.
On May 5, 2006, at 19:10, Gloria wrote:

> I was hoping to prompt for and read developer responses directly in  
> the pre-commit script, but this does not seem to work, although  
> SVNLOOK seems to be able to prompt and take interative user input.
>
> My question is, why can't the pre-commit script itself run  
> interactively? To get interactive responses, do I need to take  
> control of  STDIN, STDOUT, STDERR?
>
> I was expecting standard shell script behavior from pre-commit, but  
> this is not what I am seeing.

Hooks are not interactive. start-* and pre-* hooks can send an error  
message and a status code back to the client on failure. AFAIK post-*  
hooks cannot interact with the client at all.

The only relevant issue I can find:

http://subversion.tigris.org/issues/show_bug.cgi?id=443

That's not about interactivity of hooks, though; it's just about  
allowing all hooks to report errors or status messages back to the  
client. It's been open for close to five years, but at least it's  
being worked on periodically.



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: Interactive pre-commit hook script?

Posted by Marcus Rueckert <da...@web.de>.
On 2006-05-05 13:10:17 -0400, Gloria wrote:
> I am currently implementing some complex code checking conditions 
> specific to our application.
> 
> I was hoping to prompt for and read developer responses directly in the 
> pre-commit script, but this does not seem to work, although SVNLOOK 
> seems to be able to prompt and take interative user input.
> 
> My question is, why can't the pre-commit script itself run 
> interactively? To get interactive responses, do I need to take control 
> of  STDIN, STDOUT, STDERR?
> 
> I was expecting standard shell script behavior from pre-commit, but this 
> is not what I am seeing.

now imagine the script is run by a remote server.
e.g. with svn+ssh stdin and stdout are already taken for the actual
transport. stderr is send to the client. but there is no channel left
for pushing the response through to the script.

interactive hooks scripts is nothing you really want. imho.

just my 2 cents,

darix

-- 
           openSUSE - SUSE Linux is my linux
               openSUSE is good for you
                   www.opensuse.org

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

Re: Interactive pre-commit hook script?

Posted by Gloria Willadsen <st...@comcast.net>.
Understood. I will alias the client-side command to run my script on the 
client end before invoking subversion.
Thank you for your quick responses.
Gloria

> On 5/5/06, Gloria <st...@comcast.net> wrote:
>
>> My question is, why can't the pre-commit script itself run
>> interactively?
>
>
> Because the script runs on the server, and there's a network of
> unknown distance and latency between the server and the client.  To
> make things even more complex, there are at 3 different network
> protocol implementations (the whole network layer is abstracted.) What 
> you're asking for would be really, really hard to implement.
>
> The goal of the pre-commit hook is to simply accept or reject a
> commit.  If you want to have a whole interactive thing, then have your
> developers run the script on their client.  (The pre-commit hook can
> say somethng like, "commit rejected:  run the interactive script to
> fix your code.")
>


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: Interactive pre-commit hook script?

Posted by Gloria Willadsen <st...@comcast.net>.
Understood. I will alias the client-side command to run my script on the 
client end before invoking subversion.
Thank you for your quick responses.
Gloria

> On 5/5/06, Gloria <st...@comcast.net> wrote:
>
>> My question is, why can't the pre-commit script itself run
>> interactively?
>
>
> Because the script runs on the server, and there's a network of
> unknown distance and latency between the server and the client.  To
> make things even more complex, there are at 3 different network
> protocol implementations (the whole network layer is abstracted.) What 
> you're asking for would be really, really hard to implement.
>
> The goal of the pre-commit hook is to simply accept or reject a
> commit.  If you want to have a whole interactive thing, then have your
> developers run the script on their client.  (The pre-commit hook can
> say somethng like, "commit rejected:  run the interactive script to
> fix your code.")
>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

Re: Interactive pre-commit hook script?

Posted by Ben Collins-Sussman <su...@red-bean.com>.
On 5/5/06, Gloria <st...@comcast.net> wrote:

> My question is, why can't the pre-commit script itself run
> interactively?

Because the script runs on the server, and there's a network of
unknown distance and latency between the server and the client.  To
make things even more complex, there are at 3 different network
protocol implementations (the whole network layer is abstracted.) 
What you're asking for would be really, really hard to implement.

The goal of the pre-commit hook is to simply accept or reject a
commit.  If you want to have a whole interactive thing, then have your
developers run the script on their client.  (The pre-commit hook can
say somethng like, "commit rejected:  run the interactive script to
fix your code.")

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org


Re: Interactive pre-commit hook script?

Posted by Marcus Rueckert <da...@web.de>.
On 2006-05-05 13:10:17 -0400, Gloria wrote:
> I am currently implementing some complex code checking conditions 
> specific to our application.
> 
> I was hoping to prompt for and read developer responses directly in the 
> pre-commit script, but this does not seem to work, although SVNLOOK 
> seems to be able to prompt and take interative user input.
> 
> My question is, why can't the pre-commit script itself run 
> interactively? To get interactive responses, do I need to take control 
> of  STDIN, STDOUT, STDERR?
> 
> I was expecting standard shell script behavior from pre-commit, but this 
> is not what I am seeing.

now imagine the script is run by a remote server.
e.g. with svn+ssh stdin and stdout are already taken for the actual
transport. stderr is send to the client. but there is no channel left
for pushing the response through to the script.

interactive hooks scripts is nothing you really want. imho.

just my 2 cents,

darix

-- 
           openSUSE - SUSE Linux is my linux
               openSUSE is good for you
                   www.opensuse.org

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: Interactive pre-commit hook script?

Posted by Ryan Schmidt <su...@ryandesign.com>.
On May 5, 2006, at 19:10, Gloria wrote:

> I was hoping to prompt for and read developer responses directly in  
> the pre-commit script, but this does not seem to work, although  
> SVNLOOK seems to be able to prompt and take interative user input.
>
> My question is, why can't the pre-commit script itself run  
> interactively? To get interactive responses, do I need to take  
> control of  STDIN, STDOUT, STDERR?
>
> I was expecting standard shell script behavior from pre-commit, but  
> this is not what I am seeing.

Hooks are not interactive. start-* and pre-* hooks can send an error  
message and a status code back to the client on failure. AFAIK post-*  
hooks cannot interact with the client at all.

The only relevant issue I can find:

http://subversion.tigris.org/issues/show_bug.cgi?id=443

That's not about interactivity of hooks, though; it's just about  
allowing all hooks to report errors or status messages back to the  
client. It's been open for close to five years, but at least it's  
being worked on periodically.



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

Re: Interactive pre-commit hook script?

Posted by Ben Collins-Sussman <su...@red-bean.com>.
On 5/5/06, Gloria <st...@comcast.net> wrote:

> My question is, why can't the pre-commit script itself run
> interactively?

Because the script runs on the server, and there's a network of
unknown distance and latency between the server and the client.  To
make things even more complex, there are at 3 different network
protocol implementations (the whole network layer is abstracted.) 
What you're asking for would be really, really hard to implement.

The goal of the pre-commit hook is to simply accept or reject a
commit.  If you want to have a whole interactive thing, then have your
developers run the script on their client.  (The pre-commit hook can
say somethng like, "commit rejected:  run the interactive script to
fix your code.")

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org