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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T07:12:37+00:00 2026-06-17T07:12:37+00:00

Using svn diff with the –summarize flag returns something like the below. How would

  • 0

Using svn diff with the --summarize flag returns something like the below. How would we pass this to sed or grep to do the following:

  1. Remove any lines that start with “D” (deleted files)
  2. Remove the prefix of the “M”, “A” or “MM” (or any other cases) along with the tab afterward.
  3. Remove the URL path only leaving the filenames/folder.
  4. Store in a file

Example:

D   https://localhost/example/test1.php
D   https://localhost/example/test2.php
M   https://localhost/example/test3.php
M   https://localhost/example/test4.php
A   https://localhost/example/test5.php
M   https://localhost/example/test6.php
A   https://localhost/example/test7.php
M   https://localhost/example/test8.php
M   https://localhost/example/test9.php
M   https://localhost/example/test10.php
A   https://localhost/example/test11.php
M   https://localhost/example/test12.php
M   https://localhost/example/test13.php
MM  https://localhost/example/test.php
M   https://localhost/test0.php

Would then become:

/example/test3.php
/example/test4.php
/example/test5.php
/example/test6.php
/example/test7.php
/example/test8.php
/example/test9.php
/example/test10.php
/example/test11.php
/example/test12.php
/example/test13.php
/example/test.php
/test0.php
  • 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-06-17T07:12:38+00:00Added an answer on June 17, 2026 at 7:12 am

    Like this with sed:

    $ svn diff --summarize | sed -e '/^D/d' -e 's/.*host//'
    /example/test3.php
    /example/test4.php
    /example/test5.php
    /example/test6.php
    /example/test7.php
    /example/test8.php
    /example/test9.php
    /example/test10.php
    /example/test11.php
    /example/test12.php
    /example/test13.php
    /example/test.php
    /test0.php
    
    # Redirect output to file
    $ svn diff --summarize | sed -e '/^D/d' -e 's/.*host//' > file
    

    You need to pipe | the output of svn to sed. The first part '/^D/d' deletes all the lines starting with D and the second s/.*host// substitutes everything up to host with nothing, to store in to a file use redirect > file.

    Similar logic with grep:

    $ svn diff --summarize | grep '^[^D]' file | grep -Po '(?<=host).*' > file
    

    The first grep filters out the lines that start with D and the second uses positive lookahead with -Po to display only the part of the line after host.

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

Sidebar

Related Questions

I can get diffs between two revisions using something like svn diff -r 100:200
I want tkdiff (or something like it) to display my 'svn diff' so that
So in SVN you can do things like: svn merge -r555:558 svn diff -c551
   Suppose I generate diff of my project before commit, let say using svn. Having
I would like to create a diff (patch) file between two revisions for a
$svn diff > patchfile creates a nice patchfile. However, using TortoiseSVN under Windows I've
When using mercurial, I'd like to be able to diff the working copy of
I've started using svn with Versions.app locally, as I want to keep trace of
I am using svn merge urlToSomeBranch from my working subversion copy of a freshly
I am using svn to download the source code to an open source project.

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.