How do you see recent SVN log entries?

Svn

Svn Problem Overview


Typing svn log spits out an incredibly long, useless list on a command line. I have no idea why that is the default. If I wanted to read (or even could read) 300 entries on the terminal, I wouldn't mind typing svn log --full or something similar.

Perhaps the SVN guys are thinking I wanted to feed that output to another program. However, if that is the case, it would make more sense to have the more verbose call for the program - not the terminal user.

Anyway, how do I see just some recent activity like the last 5 or 10 entries to see what changed?

Svn Solutions


Solution 1 - Svn

limit option, e.g.:

svn log --limit 4

svn log -l 4

Only the last 4 entries

Solution 2 - Svn

Besides what Bert F said, many commands, including log has the -r (or --revision) option. The following are some practical examples using this option to show ranges of revisions:

To list everything in ascending order:

svn log -r 1:HEAD

To list everything in descending order:

svn log -r HEAD:1

To list everything from the thirteenth to the base of the currently checked-out revision in ascending order:

svn log -r 13:BASE

To get everything between the given dates:

svn log -r {2011-02-02}:{2011-02-03}

You can combine all the above expressions with the --limit option, so that can you have a quite granular control over what is printed. For more info about these -r expressions refer to svn help log or the relevant chapter in the book Version Control with Subversion

Solution 3 - Svn

I like to use -v for verbose mode.
It'll give you the commit id, comments and all affected files.

svn log -v --limit 4

Example of output:

> I added some migrations and deleted a test xml file > ------------------------------------------------------------------------ > r58687 | mr_x | 2012-04-02 15:31:31 +0200 (Mon, 02 Apr 2012) | 1 line Changed > paths: > A /trunk/java/App/src/database/support
> A /trunk/java/App/src/database/support/MIGRATE
> A /trunk/java/App/src/database/support/MIGRATE/remove_device.sql > D /trunk/java/App/src/code/test.xml

Solution 4 - Svn

Pipe the output through less or other pager:

svn log | less

Solution 5 - Svn

In case anybody is looking at this old question, a handy command to see the changes since your last update:

svn log -r $(svn info | grep Revision | cut -f 2 -d ' '):HEAD -v

LE (thanks Gary for the comment)
same thing, but much shorter and more logical:

svn log -r BASE:HEAD -v

Solution 6 - Svn

To add to what others have said, you could also create an alias in your .bashrc or .bash_aliases file:

alias svnlog='svn log -l 30 | less'

or whatever you want as your default

Solution 7 - Svn

This answer is directed at further questions regarding Subversion subcommands options. For every available subcommand (i.e. add, log, status ...), you can simply add the --help option to display the complete list of available options you can use with your subcommand as well as examples on how to use them. The following snippet is taken directly from the svn log --help command output under the "examples" section :

Show the latest 5 log messages for the current working copy
directory and display paths changed in each commit:
  svn log -l 5 -v

Solution 8 - Svn

But svn log is still in reverse order, i.e. most recent entries are output first, scrolling off the top of my terminal and gone. I really want to see the last entries, i.e. the sorting order must be chronological. The only command that does this seems to be svn log -r 1:HEAD but that takes much too long on a repository with some 10000 entries. I've come up this this:

Display the last 10 subversion entries in chronological order:

svn log -r $(svn log -l 10 | grep '^r[0-9]* ' | tail -1 | cut -f1 -d" "):HEAD

Solution 9 - Svn

As you've already noticed svn log command ran without any arguments shows all log messages that relate to the URL you specify or to the working copy folder where you run the command.

You can always refine/limit the svn log results:

  • svn log --limit NUM will show only the first NUM of revisions,

  • svn log --revision REV1(:REV2) will show the log message for REV1 revision or for REV1 -- REV2 range,

  • svn log --search will show revisions that match the search pattern you specify (the command is available in Subversion 1.8 and newer client). You can search by

    • revision's author (i.e. committers username),
    • date when the revision was committed,
    • revision comment text (log message),
    • list of paths changed in revision.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionXeoncrossView Question on Stackoverflow
Solution 1 - SvnBert FView Answer on Stackoverflow
Solution 2 - SvnDaniel DinnyesView Answer on Stackoverflow
Solution 3 - SvnJonas SöderströmView Answer on Stackoverflow
Solution 4 - SvnGreg HewgillView Answer on Stackoverflow
Solution 5 - SvnCatalinView Answer on Stackoverflow
Solution 6 - Svnjames-geldartView Answer on Stackoverflow
Solution 7 - Svnh3X3nView Answer on Stackoverflow
Solution 8 - SvnOthmar WiggerView Answer on Stackoverflow
Solution 9 - SvnbahrepView Answer on Stackoverflow