Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?

Automating tests before a CVS commit

by EvdB (Deacon)
on Jul 08, 2004 at 09:57 UTC ( #372727=perlquestion: print w/replies, xml ) Need Help??

EvdB has asked for the wisdom of the Perl Monks concerning the following question:

Before commiting files to my CVS repository I would like some checks to be run:
# Todo before commiting for *.pl, *.pm, *.PL perl -c $file perltidy -b $file ./Build test
I seem to remember that this can be done but cannot find anything here or on Google that helps. I'm probably not using the right jargon. Does anyone have a way to do this and are there other things that should be done before a commit?

update: Sod's law: Automating tests before a CVS commit. Still interested in other things that could/should be done before a commit.

--tidiness is the memory loss of environmental mnemonics

Replies are listed 'Best First'.
Re: Automating tests before a CVS commit
by davorg (Chancellor) on Jul 08, 2004 at 09:59 UTC
    You can add these items you your project's "commitinfo" file.

    "The first rule of Perl club is you do not talk about Perl club."
    -- Chip Salzenberg

      I'm having trouble getting this working as I want it to.
      --- commitinfo --- pl$ $CVSROOT/CVSROOT/commit-perl.bash pm$ $CVSROOT/CVSROOT/commit-perl.bash PL$ $CVSROOT/CVSROOT/commit-perl.bash --- commit-perl.bash --- #!/bin/bash perl -c $1 || exit 1 perltidy -b $1 || exit 1 --- --- #!/usr/bin/perl my $test = '";
      I am still allowed to commit, even though I shouldn't be. Any suggestions.

      Also I would like to run tests locally (ie not on server). Can this be done?.

      --tidiness is the memory loss of environmental mnemonics

Re: Automating tests before a CVS commit
by iburrell (Chaplain) on Jul 08, 2004 at 16:15 UTC
    CVS does not support running scripts on the client before doing a commit. It does have a mechanism, the commitinfo file, for running commands on the server before doing a commit. The program can abort the commit by returning a non-zero exit code.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://372727]
Approved by pelagic
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (4)
As of 2020-06-04 21:27 GMT
Find Nodes?
    Voting Booth?
    Do you really want to know if there is extraterrestrial life?

    Results (35 votes). Check out past polls.