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

  • Home
  • SEARCH
  • 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 3803310
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T14:20:35+00:00 2026-05-19T14:20:35+00:00

We use Tortoise SVN for source control, and have already set up a commit

  • 0

We use Tortoise SVN for source control, and have already set up a commit message template.

I would also like to display some text to the user when they commit, that doesn’t get included in their commit message, along the lines of “Don’t forget to do X!”.

Is this possible?

  • 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-19T14:20:36+00:00Added an answer on May 19, 2026 at 2:20 pm

    I have set up a similar environment using the Tortoise Docs and can say: Yes, it is! Operation involves a Start-Commit Hook that fills in the lines that the user shall read and a Pre-Commit Hook that removes thee lines again:

    Start-Commit Hook
    This hook gets passed three parameters: PATH MESSAGEFILE CWD. MESSAGEFILE is the path to a temporary file that will be used for storing the commit message. You can fill this temporary file with your message Don’t forget to do X! Or, you prefix your message with something that you will treat as comment in the commit message and gets filtered out. Since Git uses # as comment in the commit message, I did the same: every line that starts with # gets filtered out of the commit message. And therefore I’d write the message # Don't forget to do X!. Sample implementation in Perl (untested):

    use strict;                         # what we always have
    use warnings;                       # what we always have
    use Fcntl ':flock';                 # lock files when writing
    use Carp;                           # use croak instead of die
    use English qw( -no_match_vars );   # words instad of cryptic variables
    
    sub startcommit_hook{
      # open the logfile
      my $logfilename       = $ARGV[1];
      # write hint line about supported tags
      open my $handle, '>:utf8', $logfilename
        or croak "Opening $logfilename for writing failed\n";
      flock $handle, LOCK_EX;
        print {$handle} "# Don't forget to do X!\n";
      flock $handle, LOCK_UN;
      return close $handle or croak "unable to close $OS_ERROR";
    }
    
    startcommit_hook();
    

    Pre-Commit Hook
    This hook gets passed four parameters: PATH DEPTH MESSAGEFILE CWD. The job of the pre-commit hook is to filter out the message that you filled into MESSAGEFILE in in the start-commit hook (otherwise it will go as part of the commit message to the server and this probably isn’t what you want). Either just delete your message Don’t forget to do X! or – if you use the comment approach as I wrote above – delete every line that starts with a # sign (or that matches the pattern ^\s*#) since it’s a comment in our world.

    We could extend our file for the start-commit hook to handle also the pre-commit stuff since the number of parameters is different. The decision on which hook to call is made up of the parameter count passed to the script (also untested):

    use strict;                         # what we always have
    use warnings;                       # what we always have
    use feature 'switch';               # for given-when construct
    use Fcntl ':flock';                 # lock files when writing
    use Carp;                           # use croak instead of die
    use English qw( -no_match_vars );   # words instad of cryptic variables
    
    sub startcommit_hook{
      # open the logfile
      my $logfilename       = $ARGV[1];
      # write hint line about supported tags
      open my $handle, '>:utf8', $logfilename
        or croak "Opening $logfilename for writing failed\n";
      flock $handle, LOCK_EX;
        print {$handle} "# Don't forget to do X!\n";
      flock $handle, LOCK_UN;
      return close $handle or croak "unable to close $OS_ERROR";
    }
    
    sub precommit_hook{
      my $logfilename       = $ARGV[2];
      # first, read the logfile
      open my $handle,'<:utf8',$logfilename or croak "Error reading file contents of $logfilename: $OS_ERROR\n";
      my @content = <$handle>;
      close $handle or croak "unable to close: $OS_ERROR";
      chomp @content;
    
      # now, write it, ignoring the comment lines
      open my $handle, '>:utf8', $logfilename
        or croak "Opening $logfilename for writing failed\n";
      flock $handle, LOCK_EX;
    
      foreach my $line(@content){
        if($line !~ /^\s*#/){   # line has no comment, print it.
          print {$handle} $line . "\n";
        }
      }
    
      flock $handle, LOCK_UN;
      close $handle or croak "unable to close $OS_ERROR";
      return;
    }
    
    given($#ARGV){
      when (3){startcommit_hook();}
      when (4)   {precommit_hook();}  # no user supplied -> auto lookup
      default  {croak "Invalid number of parameters";}
    }
    

    To activate the hooks, open the settings of TortoiseSVN, go to hook scripts and add the script once as start-commit hook and once as pre-commit hook. The command line to call would be perl /path/to/script. And also check Wait for the script to finish and Hide script while running.

    Note
    If you need further information passed to the hooks, you could also pass custom parameters when you assign the hooks in the settings of TortoiseSVN. If you assign custom parameters, these get passed to the hook before the default parameters (as stated in the docs) get passed.

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

Sidebar

Related Questions

Can I use Tortoise SVN to have better version control for source code on
I use Tortoise SVN usuallly, but I have been looking into Mercurial since it
I am just starting to use Subversion with Tortoise SVN client for one of
How am I supposed to use merge with the latest version of Tortoise SVN?
I have TortoiseSVN set up to use KDiff3 as the conflict resolution tool (I
I have a Windows 7 x64 machine with Tortoise SVN 32 and 64 bits
(please excuse that I didn't use aliases). I would like my query output to
We have just started using VisualSVN, TortoiseSVN and ankhSVN plug-in to handle our source
I want to be able to search within the commit logs of svn. I
My question is about memory use and objects in actionscript 2. If I have

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.