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 7612843
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T02:01:06+00:00 2026-05-31T02:01:06+00:00

I’m using SVN commit comments to associate some keywords to the commited files. I’m

  • 0

I’m using SVN commit comments to associate some keywords to the commited files. I’m trying now to find all commited files – in any revision – having a specific keyword in the comment. Is it possible ?

Thanks by advance !

EDIT for more info : I can use TortoiseSVN (from my local, Windows Seven 64bit) or Command Line (from our integration server, linux)

Edit again : “show log” in tortoise don’t let me searching from any date. Right now I can’t search from last year… but only from 15/02/2012… Any way to fix that ?

=============================================================================

FINAL ANSWER :
I finally made it work as I wanted. I wanted to get all these logs to use them for svn exports. The final script is named ExportAllRevisionsFromKeyword.sh :

    #!/bin/sh
    if [ ! $1 ];then echo "No keyword specified. Needs for example a ticket number : PROJECT-XXX. The command will be : ./SearchCommitsFromComment.sh PROJECT-XXX";exit;fi
    cd /root/PROJETS/myproject/
    SEARCH=$1
    echo "Searching revisions committed with keyword "$SEARCH
    svn log | awk '{
      if ( $1 == "------------------------------------------------------------------------") {
        getline
        REVISION = $1
      }
      else {
        if (match($0, SEARCH)) {
          print "Keyword found in " REVISION ". Export coming..."
          system("./var/batchesFolder/svnxport.sh . " substr(REVISION,2) " var/batchesFolder/sorties/svnExports/" SEARCH)
        }
      }

    }' SEARCH="$SEARCH"

As you can see I’m calling another script. It was inspired by Julien Falconet’s tutorial, named svnxport.sh :

    #!/bin/sh
    # svnxport.sh
    # Export only modified files in SVN
    #
    #  Copyright (C) 2009 by Julien Falconnet
    #  http://www.falconnet.fr
    #
    #  This program is free software; you can redistribute it and/or modify
    #  it under the terms of the GNU General Public License as published by
    #  the Free Software Foundation; either version 2 of the License, or
    #  any later version.
    #
    #
    #BEWARE : This script does not operate correctly with files whose filename contains spaces
    # tests for parameters
    if [ ! $1 ];then echo "svnxport : No source specified. Needs : source revision target_directory";exit;fi
    if [ ! $2 ];then echo "svnxport : No revision specified. Needs : source revision target_directory";exit;fi
    if [ ! $3 ];then echo "svnxport : No target_directory specified. Needs : source revision target_directory";exit;fi
    # check if the target_directory allready exists
    #if [ -d $3 ];then echo "svnxport : target_directory '$3' allready exists. Remove it or change target_directory parameter.";exit;fi


    # we use svn diff to select changed files between $2-1 and $2 revisions and only keep those updated or added.
    sourceDir=$1
    revision=$2
    previous=$(($revision - 1))
    targetDir=$3
    escapedSourceDir=$1
    if [ $escapedSourceDir == '.' ]
    then
      escapedSourceDir='\\.'
    fi


    echo "Processing : source($sourceDir), revision($revision), target_directory($targetDir)"

    # Then the 'for' separate status from filename (here is the problem with file with blanks)
    for myfile in `svn diff -r $previous:$revision --summarize $sourceDir | grep -e '^M ' -e '^A '`
    do
    if  [  "$myfile" = "M"  -o  "$myfile" = "AM" -o "$myfile" = "A" -o "$myfile" = "." -o -d $myfile ]
    then
        # we ignore the status, and the directory to update
        continue
    else
        #we focus on true changed files
        #first we create needed directories for the current file
        #note that we use a relative directory system
        outfile=`echo $myfile |sed "s|$escapedSourceDir||g"`
        dir="$targetDir/$outfile"
        mkdir -p $(dirname $dir)
        #then we export the file
        svn export --force $myfile $targetDir/$outfile >> /dev/null
        echo "export $targetDir/$outfile "
    fi
    done
    # List other files. Changed but not exported. Mainly the deleted ones.
    # Usefull to know which files should be removed and follow weird comportment
    #echo "Watch for : "
    #svn diff -r $previous:$revision --summarize $sourceDir | grep -v -e 'M ' -e 'A ' |sed "s|$sourceDir||g"
    echo $'\n'

And now, the only action to do is cd into my versionned website root, and call
./path/to/scripts/ExportAllRevisionsFromKeyword.sh PROJECT-XXX

It will search any revision committed with comment containing “PROJECT-XXX” keyword, and will export the HEAD revision of files modified by that revision into a new folder : path/to/scripts/sorties/svnExports/PROJECT-XXX

I need to say that Nishant was very helpful with the link he gave to me. Thank you so much ! 🙂

  • 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-31T02:01:07+00:00Added an answer on May 31, 2026 at 2:01 am

    try something like

      svn log | grep <my comment>
    

    Or do something like this

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

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I have thousands of HTML files to process using Groovy/Java and I need to
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
That's pretty much it. I'm using Nokogiri to scrape a web page what has
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have just tried to save a simple *.rtf file with some websites and
For some reason, after submitting a string like this Jack’s Spindle from a text
I am trying to understand how to use SyndicationItem to display feed which is
I have a jquery bug and I've been looking for hours now, I can't
I am reading a book about Javascript and jQuery and using one of the

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.