You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by ExtraPic <ex...@extrapic.com> on 2008/07/08 08:10:53 UTC

Precommit hook absent from subversion

I am well aware that subversion offers a so called precommit hook, as
well as others. But this not what I have always meant by precommit or
what CVS offers us. 

I want the ability to abort a svn checkin before the user is asked
for a commit message, based on information available. We have always 
done this in CVS to the extent that in our (probably wrong) 
thinking pre means pre edit, and post means post edit of the commit 
message. I am not of course concerned with terminology, call it what you
like that is not the point of this email. 

Why is this important? Because a good commit message represents a fair
bit of work for a developer. Its really tempting not to spend that 
effort, and just make a message that says "issue fixed" or suchlike. I
want to help our developers as much as possible, by rejecting the
checkin before the editor comes up so far as I am able, to spare him/her
from that effort and then be confronted with the fact that they are
commiting to the wrong branch or need authorisation privileges. I want
that to never happen! And yes, I know you can re-use the same message,
but often people do not know or do this. 

I am not of course asking that subversion write the hook for me. What I
am asking for is that subversion provide me a hook with as much
information as possible, (meta data, username filepath is the type of
thing I might need, all the usual stuff) so that I can do this. Thats
what hooks are for.

At the moment it seems to me that you cannot do this in subversion at
all. Its a simple thing to ask for. Or did I miss something? 

Does anyone agree this should go in the bugtracker as a feature
request? 

Mark Winder



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

Re: Precommit hook absent from subversion

Posted by John Peacock <jo...@havurah-software.org>.
ExtraPic wrote:
> I want the ability to abort a svn checkin before the user is asked
> for a commit message, based on information available. 

> At the moment it seems to me that you cannot do this in subversion at
> all. Its a simple thing to ask for. Or did I miss something? 

You are correct - you cannot do this in Subversion at all.  In fact, the 
architecture specifically prevents this sort of hook from being 
implemented, because the generation of a commit message is a client-side 
operation, and happens before the server is even contacted.  Only when 
the client has a complete transaction (data to commit plus log message) 
does it connect to the server.  Only then can the pre-commit hook fire 
(which can be used to validate the log message for example).

I don't think this is going to be something that will change...

Sorry

John

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

Re: Precommit hook absent from subversion

Posted by mark <ex...@extrapic.com>.
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=us-ascii" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
<br>
Well thats very clear, even if not what I wanted to hear. <br>
Thanks guys. <br>
<br>
<br>
<blockquote cite="mid:18547.42862.992526.934204@gargle.gargle.HOWL"
 type="cite">
  <blockquote type="cite">
    <blockquote type="cite">
      <blockquote type="cite">
        <blockquote type="cite">
          <blockquote type="cite">
            <pre wrap="">"extrapic" == extrapic  <a class="moz-txt-link-rfc2396E" href="mailto:extrapic@extrapic.com">&lt;extrapic@extrapic.com&gt;</a> writes:
            </pre>
          </blockquote>
        </blockquote>
      </blockquote>
    </blockquote>
  </blockquote>
  <pre wrap=""><!---->
 extrapic&gt; .... I want to help our
 extrapic&gt; developers as much as possible, by rejecting the checkin
 extrapic&gt; before the editor comes up so far as I am able, to spare
 extrapic&gt; him/her from that effort and then be confronted with the
 extrapic&gt; fact that they are commiting to the wrong branch or need
 extrapic&gt; authorisation privileges. I want that to never happen! And
 extrapic&gt; yes, I know you can re-use the same message, but often
 extrapic&gt; people do not know or do this.

But svn tells you explicitly.  If a checkin fails due to a pre-commit
script rejection, the message is saved and svn says where it saved it.

So all your users have to know is "svn ci -F &lt;savedfile&gt; ..."  Not
that hard, it seems to me.

     paul


---------------------------------------------------------------------
To unsubscribe, e-mail: <a class="moz-txt-link-abbreviated" href="mailto:users-unsubscribe@subversion.tigris.org">users-unsubscribe@subversion.tigris.org</a>
For additional commands, e-mail: <a class="moz-txt-link-abbreviated" href="mailto:users-help@subversion.tigris.org">users-help@subversion.tigris.org</a>


ExtraPic wrote:

  </pre>
  <blockquote type="cite">I want the ability to abort a svn checkin
before the user is asked
    <br>
for a commit message, based on information available. </blockquote>
  <br>
  <blockquote type="cite">At the moment it seems to me that you cannot
do this in subversion at
    <br>
all. Its a simple thing to ask for. Or did I miss something? </blockquote>
  <br>
You are correct - you cannot do this in Subversion at all.&nbsp; In fact,
the architecture specifically prevents this sort of hook from being
implemented, because the generation of a commit message is a
client-side operation, and happens before the server is even
contacted.&nbsp; Only when the client has a complete transaction (data to
commit plus log message) does it connect to the server.&nbsp; Only then can
the pre-commit hook fire (which can be used to validate the log message
for example).
  <br>
  <br>
I don't think this is going to be something that will change...
  <br>
  <br>
Sorry
  <br>
  <br>
John
  <pre wrap="">
  </pre>
</blockquote>
<br>
</body>
</html>

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

Re: Precommit hook absent from subversion

Posted by Paul Koning <Pa...@dell.com>.
>>>>> "extrapic" == extrapic  <ex...@extrapic.com> writes:

 extrapic> .... I want to help our
 extrapic> developers as much as possible, by rejecting the checkin
 extrapic> before the editor comes up so far as I am able, to spare
 extrapic> him/her from that effort and then be confronted with the
 extrapic> fact that they are commiting to the wrong branch or need
 extrapic> authorisation privileges. I want that to never happen! And
 extrapic> yes, I know you can re-use the same message, but often
 extrapic> people do not know or do this.

But svn tells you explicitly.  If a checkin fails due to a pre-commit
script rejection, the message is saved and svn says where it saved it.

So all your users have to know is "svn ci -F <savedfile> ..."  Not
that hard, it seems to me.

     paul


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