Jeff
Jeff

Reputation: 2009

How can I use svn log to find the last checkins?

I was trying use svn to find a checkin using "svn log", but it seems like svn log is limited somehow. I started at the root of our source tree, and I did "svn log -l 10" and it gives me revision information for revisions 958 - 949. However, if I do "svn log -r HEAD:900 -l 10", I get revision information for revisions 998 - 989. Why is that? It seems backwards to me - "svn log -l 10" should give the 10 latest, right? Why do I need all the other parameters to make this work? If I do "svn log -r HEAD" I get just one log entry. I want to be able to get all log entries, then I could grep the results. There must be an easier way?

Upvotes: 1

Views: 834

Answers (2)

Wrikken
Wrikken

Reputation: 70460

~$ svn help log
log: Show the log messages for a set of revision(s) and/or file(s).
usage: 1. log [PATH]
       2. log URL[@REV] [PATH...]

  1. Print the log messages for a local PATH (default: '.').
     The default revision range is BASE:1.

So, by design, it starts at BASE. not HEAD if you use a path.

  2. Print the log messages for the PATHs (default: '.') under URL.
     If specified, REV determines in which revision the URL is first
     looked up, and the default revision range is REV:1; otherwise,
     the URL is looked up in HEAD, and the default revision range is
     HEAD:1.

If I do "svn log -r HEAD" I get just one log entry. I want to be able to get all log entries, then I could grep the results.

By all means, don't limit then:

 svn log HEAD:1

Upvotes: 0

chmeee
chmeee

Reputation: 3638

I've experienced this same thing. I solved it by doing an 'svn up' before an 'svn log'. My understanding from this is that svn will only list what it knows about the server, and it doesn't know about your commits (it only pushed them, it didn't cache them).

Upvotes: 2

Related Questions