ahtmatrix
ahtmatrix

Reputation: 569

How can I view svn logs from newest to oldest?

currently whenever I type:

svn log

it'll display revision 1 first, then i have to scroll all the way up for the latest revision.

Is there a way I can view the latest revision first and the oldest last?

Upvotes: 1

Views: 2039

Answers (2)

Ben Reser
Ben Reser

Reputation: 5765

First of Subversion does display logs with the youngest revision (highest) first and going back in history towards the oldest (lowest) revision on the command line by default. Specifically if no revision is specified it'll use -r BASE:1 as the range, where BASE is the revision your working copy is at.

I suspect your problem is partially that your working copy BASE is older than you expect and if you have a fresh repo you may not realize that you're just not seeing part of the history. You can run svn update to update your BASE revision and then log will show more revisions.

If you want to always see all revisions use svn log -r HEAD:1. If you want to see them in reverse order (oldest first, newest last) you can just reverse the order of the ranges svn log -r 1:HEAD.

Upvotes: 2

Lazy Badger
Lazy Badger

Reputation: 97270

Well, for fresh SVN default log

>svn log -q
------------------------------------------------------------------------
r5 | lazybadger | 2014-02-07 12:06:56 +0600 (Пт, 07 фев 2014)
------------------------------------------------------------------------
r4 | lazybadger | 2013-11-28 02:35:01 +0600 (Чт, 28 ноя 2013)
------------------------------------------------------------------------
r3 | lazybadger | 2013-11-28 01:13:37 +0600 (Чт, 28 ноя 2013)
------------------------------------------------------------------------
r2 | lazybadger | 2013-11-28 00:13:01 +0600 (Чт, 28 ноя 2013)
------------------------------------------------------------------------
r1 | www-data | 2013-11-27 18:13:32 +0600 (Ср, 27 ноя 2013)
------------------------------------------------------------------------

in case of inverse order you can use revision range specification and -r option

>svn log -q -r 1:HEAD
------------------------------------------------------------------------
r1 | www-data | 2013-11-27 18:13:32 +0600 (Ср, 27 ноя 2013)
------------------------------------------------------------------------
r2 | lazybadger | 2013-11-28 00:13:01 +0600 (Чт, 28 ноя 2013)
------------------------------------------------------------------------
r3 | lazybadger | 2013-11-28 01:13:37 +0600 (Чт, 28 ноя 2013)
------------------------------------------------------------------------
r4 | lazybadger | 2013-11-28 02:35:01 +0600 (Чт, 28 ноя 2013)
------------------------------------------------------------------------
r5 | lazybadger | 2014-02-07 12:06:56 +0600 (Пт, 07 фев 2014)
------------------------------------------------------------------------

Upvotes: 4

Related Questions