Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 549931
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T11:14:08+00:00 2026-05-13T11:14:08+00:00

Is it possible to use the commit message in a pre-commit hook in CVS?

  • 0

Is it possible to use the commit message in a pre-commit hook in CVS? The CVS server is running remotely, and I access it using pserver.

Ideally, I want to allow the commit if the files pass the filter or the commit message contains certain text.

I don’t have a choice to use another versioning system.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T11:14:08+00:00Added an answer on May 13, 2026 at 11:14 am

    Here are some useful tutorials to read more:

    http://durak.org/sean/pubs/software/cvsbook/The-commitinfo-And-loginfo-And-rcsinfo-Files.html
    http://durak.org/sean/pubs/software/cvsbook/The-verifymsg-And-rcsinfo-Files.html#The-verifymsg-And-rcsinfo-Files

    You can’t do what you want with just one hook but you can use two hooks, commitinfo will let you verify the files themselves and verifymsg will let you verify the message. Both can be used to cancel the commit (the programs just need to exit with status 1). In case you weren’t aware, checkoutlist, commitinfo and ‘verifymsg’ can all be found in the CVSROOT directory of your repository. I would recommend putting any scripts you write as hooks in that directory as well, but it doesn’t really matter as you get to specify the full path. Also, perl is not necessary or required, just simple for me to write some (silly) examples in:

    checkoutlist

    # these files will be automatically checked out for you
    acceptable
    

    verifymsg

    # specifies which file to run as hook, %l is filename of log message
    # bar$     /path/to/repo/CVSROOT/verify_ends_in_bar %l
    DEFAULT    /path/to/repo/CVSROOT/acceptable %l %s
    

    acceptable

    #/usr/bin/perl -w
    
    use strict;
    use warnings;
    
    # this would be simpler if cvs passed sane arguments
    my ($logfile, $dir, @files) = @ARGV;
    my $grep = `grep -i 'accept liability' $logfile`;
    exit 0 if $grep;
    
    my $found = 0;
    foreach my $file (@files) {
        my $path = join '/', $dir, $file;
        die "Can't find file $path" if ! -e $path;
        my $grep = `grep -i 'evidence of any deliberation' $path`;
        $found++ if $grep;
    }
    die "You must accept liability or show evidence of deliberation" if $found < @files;
    

    Caveat emptor: I wrote most of this off the top of my head with no testing so I can’t guarantee it works but it should get you at least close.

    Edit again, I just realized that I was originally wrong and you can pass both the logfile and the committed filenames to verifymsg making the answer quite a bit simpler.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 278k
  • Answers 278k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer I can tell you technicaly it can work, and very… May 13, 2026 at 3:10 pm
  • Editorial Team
    Editorial Team added an answer Your typedef needs to be in the header file (or… May 13, 2026 at 3:10 pm
  • Editorial Team
    Editorial Team added an answer Refer to this link: http://msdn.microsoft.com/en-us/library/ms378526.aspx "sqljdbc4.jar class library requires a… May 13, 2026 at 3:10 pm

Related Questions

I have been experimenting with WPF and rendering strict XAML markup in a web
I am currently trying to write a little powershell script (I have no experience
So right now i need to create and implement an extension of the Python
Here's the deal: I just started a new job, and source control here is
Is it possible in any of the modern SCMs to grab a complete list

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.