63

At times I want to revisit a change I committed to SVN a short while back, but don't recall the specific files involved or the revision number. So I would like to see a list of recent commit messages, ideally including the files included in each commit.

I picture going to the root of my working copy and entering something like the following to see the messages and files associated with the most recent 5 commits:

svn log -l5 -v *

Unfortunately, this command requires a single target, and won't accept '*'. I know SVN has the information I want. Is there a simple way to retrieve it?

4 Answers 4

80

You can use svn log -l5 -v <URL of your repository>. svn info can be used to get the root URL for the repository where your working copy is connected to.

Sign up to request clarification or add additional context in comments.

3 Comments

Beautiful - Thanks! The repository URL is the * I wanted.
Then you are in a working copy. This means that the output of svn log is filtered to the sub path where the wc is connected to.
You can use '^/' inside of a working copy as a shorthand for the repository url.
23

svn log -q -v --limit N inside working copy (you have WC, isn't it?!) will show short list of latest N commits with commit-message (mea culpa, -q supress commit-message output) and files only

Log output example - repo

>svn log -q -v http://mayorat.ursinecorner.ru:8088/svn/Hello/ -l 5
------------------------------------------------------------------------
r33 | lazybadger | 2012-02-28 16:10:41 +0600 (Вт, 28 фев 2012)
Changed paths:
   M /trunk/Hello.en.txt
------------------------------------------------------------------------
r32 | lazybadger | 2011-12-27 17:37:31 +0600 (Вт, 27 дек 2011)
Changed paths:
   M /trunk/Hello.de.txt
   M /trunk/Hello.en.txt
------------------------------------------------------------------------
r31 | lazybadger | 2011-12-27 17:29:00 +0600 (Вт, 27 дек 2011)
Changed paths:
   M /trunk/Hello.de.txt
   M /trunk/Hello.en.txt
   M /trunk/Hello.fr.txt
------------------------------------------------------------------------
r30 | lazybadger | 2011-10-19 16:23:52 +0600 (Ср, 19 окт 2011)
Changed paths:
   M /trunk
------------------------------------------------------------------------
r29 | lazybadger | 2011-10-19 16:18:43 +0600 (Ср, 19 окт 2011)
Changed paths:
   M /trunk
------------------------------------------------------------------------

Secong log for commit-messages (removed -q -v)

>svn log http://mayorat.ursinecorner.ru:8088/svn/Hello/ -l 5
------------------------------------------------------------------------
r33 | lazybadger | 2012-02-28 16:10:41 +0600 (Вт, 28 фев 2012) | 1 line

One more change
------------------------------------------------------------------------
r32 | lazybadger | 2011-12-27 17:37:31 +0600 (Вт, 27 дек 2011) | 1 line

Cleanups
------------------------------------------------------------------------
r31 | lazybadger | 2011-12-27 17:29:00 +0600 (Вт, 27 дек 2011) | 1 line

Purification
------------------------------------------------------------------------
r30 | lazybadger | 2011-10-19 16:23:52 +0600 (Ср, 19 окт 2011) | 1 line

Try fix FS #2
------------------------------------------------------------------------
r29 | lazybadger | 2011-10-19 16:18:43 +0600 (Ср, 19 окт 2011) | 1 line

If I checkout repo from root and svn log in WC-rot, result will not differ at all

Hello>svn log -q -v -l 5
------------------------------------------------------------------------
r33 | lazybadger | 2012-02-28 16:10:41 +0600 (Вт, 28 фев 2012)
Changed paths:
   M /trunk/Hello.en.txt
------------------------------------------------------------------------
r32 | lazybadger | 2011-12-27 17:37:31 +0600 (Вт, 27 дек 2011)
Changed paths:
   M /trunk/Hello.de.txt
   M /trunk/Hello.en.txt
------------------------------------------------------------------------
r31 | lazybadger | 2011-12-27 17:29:00 +0600 (Вт, 27 дек 2011)
Changed paths:
   M /trunk/Hello.de.txt
   M /trunk/Hello.en.txt
   M /trunk/Hello.fr.txt
------------------------------------------------------------------------
r30 | lazybadger | 2011-10-19 16:23:52 +0600 (Ср, 19 окт 2011)
Changed paths:
   M /trunk
------------------------------------------------------------------------
r29 | lazybadger | 2011-10-19 16:18:43 +0600 (Ср, 19 окт 2011)
Changed paths:
   M /trunk

2 Comments

I had already tried this (without the '-q'), and it only seems to report commits affecting files in the current directory, and not even the most recent changes to files in the current directory. (I did mean copy, not directory, in my original post, btw, thanks. Now corrected.)
OK. Use URL as target as end it in repo root. I see file changes in repo, see my edited answer with log
3

For TortoiseSVN users:

  1. Browse to the repository folder and right click.
  2. Select TortoiseSVN > Show log

The log window appears.

  1. Select the first log and hold down Shift and select the last log you are interested in (Ctrl + A to select all. Alternatively you can use Ctrl selection method).
  2. Right click on of the selected entries and select Copy to clipboard > Messages

The log of commit messages is copied to your clipboard.

  1. Open Notepad or Notepad++ and paste the log (Ctrl + v). Save the file as you wish.

Comments

1
  1. svn log -l5 -v http://99.9.9.999/repos/reposName
    
    // This will show you only last 5 commit records
    
  2. svn log -q -v http://99.9.9.999/repos/reposName
    
    // This will show you all the commit records
    

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.