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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T06:43:47+00:00 2026-05-11T06:43:47+00:00

It is good practice to remove old code instead of just commenting it out.

  • 0

It is good practice to remove old code instead of just commenting it out. It is often claimed that the old code parts can always be found again in the old SVN repository revision, if needed.

But practically, it’s not that easy, right? If the old code is in some unknown old SVN revision then it can be quite hard to find.

I’m exactly in that situation right now: There’s a function that I don’t need anymore, and I should throw it out, since it’s in SVN, but I hesitate because I might need it again, and I’m afraid it’s going to be hard to find in the repository.

Of course, one can always make a commit message, saying ‘removed function myFunction’, but sometimes you can’t note every little code removal in the commit message, and it can also be tedious to look through all commit messages to find something again.

An automatic tool would be better, something like

svn find 'void myFunction\(' my-file.cc 

which would tell me the different results from different revisions. Does something like that exist?

EDIT: Do other version control systems have it? Git maybe? (That’d be a reason to switch, I’d say.)

UPDATE: So there’s no real answer except the tiny brittle shell script I found more or less by accident (see my answer below). I think, that’s really a shame for SVN. Finding something in earlier revisions should be one of the central functionalities of version control. Does anyone have more info?

  • 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. 2026-05-11T06:43:48+00:00Added an answer on May 11, 2026 at 6:43 am

    I googled some more and found the following script (see here). I tested it briefly and it seems to be working fine:

    rev_grep.sh ===================== #!/bin/ksh  URL=$1 REGEX=$2  LAST_REV='n/a'  svn log -q $URL | perl -ne 'print '$1\n' if /^r(\d+)/' | while read r do     ##svn cat -r $r $URL | grep '$REGEX' > /dev/null     BUFFER=`svn cat -r $r $URL | grep '$REGEX'`     RET=$?     if [ $RET -eq 0 ]     then         echo 'Match in revision: $r. Removed in $LAST_REV.'         echo $BUFFER          exit 0      elif [ $RET -ne 1 ]     then         ## grep hit an error         exit 2     fi      LAST_REV=$r done exit 1  

    The only problem is that, if your repository requires a password, you’ll have to enter it many times.

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

Sidebar

Ask A Question

Stats

  • Questions 81k
  • Answers 81k
  • 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 Not LINQ syntax, but at least more elegant... List<Note> mergedNotes… May 11, 2026 at 4:27 pm
  • Editorial Team
    Editorial Team added an answer Take a look at w3schools browser stats. Edit: Since a… May 11, 2026 at 4:27 pm
  • Editorial Team
    Editorial Team added an answer The official SDK is free but not open-source. All the… May 11, 2026 at 4:27 pm

Related Questions

I just learned about how the Java Collections Framework implements data structures in linked
Yay, first post on SO! (Good work Jeff et al.) We're trying to solve
The first thing I do in a public method is to validate every single
When assigning a default default-value to a field (here false to a bool), FxCop

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.