"svn log" not showing all recent commits

Svn

Svn Problem Overview


Note: This is probably a no-brainer for experienced SVN users, but it stumped me for quite awhile...so here's hoping this will help someone like me!

After issuing svn log from the command line, I noticed that several recent commit messages were missing. I knew that these messages were correctly saved in my repository because they were showing up in my SVN client (RapidSVN). I just couldn't figure out why they wouldn't be visible using the command line version of svn.

Answer below...

Svn Solutions


Solution 1 - Svn

The problem had to do with my poor understanding of what svn log was showing. With no other arguments supplied, it outputs log messages from the working copy of the log, not from the actual repository. Thus, issuing svn update will bring the working copy up-to-date with the repository, and then svn log will reflect all recent commits. Duh! ;-)

Solution 2 - Svn

If you would like to see the full log without updating (as I sometimes do when working on an old revision) you can run:

svn log -r HEAD:0

Or, for easier viewing:

svn log -r HEAD:0 | less

Solution 3 - Svn

I hit the same issue today and was horrified thinking I lost my changes.

It happens just because of weirdness of subversion. There is a concept of working copy that is set to the revision that was checked out originally. Working copy revision is not changed by new commits. svn update is required to update/sync working copy revision to the repository. Not sure I would like to do that in every scenario.

PS: git is so much better.

Solution 4 - Svn

You can also explicitly tell svn log to go to the server by specifying the URL of the repository.

e.g.

svn log svn://your-server/trunk

Or more generally and succinctly:

svn log ^/

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
QuestionrobguinnessView Question on Stackoverflow
Solution 1 - SvnrobguinnessView Answer on Stackoverflow
Solution 2 - Svngregpaton08View Answer on Stackoverflow
Solution 3 - SvnMohammad AzimView Answer on Stackoverflow
Solution 4 - SvnGreg BellView Answer on Stackoverflow