Changelog Between Two Tags in Subversion

Album Cover: Icky Thump

"I'm gettin' hard on myself, sittin' in my easy chair."
White Stripes / 300 M.P.H. Torrential Outpour Blues

Posted on January 18, 2006 11:30 PM in Computers
Warning: This blog entry was written two or more years ago. Therefore, it may contain broken links, out-dated or misleading content, or information that is just plain wrong. Please read on with caution.

If you're new to Subversion (or even if you aren't) and you're looking for a way to generate a changelog between two tags, look no further. The information is buried elsewhere, but as always, when I learn something that I don't think is as easy to learn as it should be, I try to do my part. This is no exception.

Generating a changelog between two tags in Subversion is a three-step process, but all three steps are relatively straightforward and simple.

First off, because log ranges are typically based on revision numbers, you need to get the first revision number of the first tag. Assuming your Subversion repository is located on the local machine at file:///dev/svn, you can obtain the revision number with:

svn log -v --stop-on-copy file:///dev/svn/tags/MY_FIRST_TAG

Similarly, you can obtain the first revision of the second tag with:

svn log -v --stop-on-copy file:///dev/svn/tags/MY_SECOND_TAG

Both of these commands will return something like the following, with the revision number you're interested in highlighted in red:

r42 | berniez | 2006-01-18 23:26:17 -0800 (Thu, 18 Jan 2006) ...

Now that you've obtained the two revision numbers you're after, you can use these to get a changelog between the two tags:

svn log -v -r42:79 file:///dev/svn/trunk

And there you have it. A changelog between two tags in Subversion. Oh, and in case you want to compare tags on a branch, just substitute branches/MY_BRANCH_NAME for trunk in the above command and you'll be all set.


Mark Ryan on March 17, 2006 at 5:46 AM:

I am not sure the above is strictly correct. For example, if I create a tag many weeks after the original revision was created on 'trunk', then the revision numbers will not be sequential. Instead, I think you should be looking at the tail of the last log entry supplied by 'svn log -v --stop-on-copy'

For example:

r42 | berniez | 2006-01-18 23:26:17 -0800 (Thu, 18 Jan 2006) ...
Changed paths:
A file:///dev/svn/tags/MY_FIRST_TAG (from /trunk:41)

Compared to me creating the same tag with the '--revision' switch (svn copy --revision 41 .../trunk .../MY_FIRST_TAG) many weeks/months later when the number of revisions in my repository has grown significantly:

r9999 | berniez | 2006-01-18 23:26:17 -0800 (Thu, 01 Feb 2010) ...
Changed paths:
A file:///dev/svn/tags/MY_FIRST_TAG (from /trunk:41)

However, subversion is never straightforward and I believe the log command doesn't report correctly. For example doing an svn log between two consecutive revisions returns the same result as doing the same log between the next two consecutive revisions.... thereby making the differences reported by 'svn log' inaccurate.

For example:

svn log --revision 40:41 svn://some-path
svn log --revision 41:42 svn://some-path

Will report exactly the same changes for a path that only has a single log change at 41..!! I suppose the safest way is to increment the first number (the lower revision) by one - hardly an elegant solution, though..!!




Toni Van de Voorde on July 23, 2009 at 1:50 AM:


Thx for this useful information, but isn't there a tool which can generate this automatically ?

When we commit, we always set for which version the commit is for Example:

[3.0,3.1] bugfix: blablbla
[3.1] feature: blablabla
etc ...

Extracting the log message is not enough, I also need to be able to parse it.

So if a tool exist, this would prevent me from writing it myself :)



deepak on November 04, 2009 at 1:29 AM:

checkout might get what u've been looking for..


Shazbot on November 13, 2009 at 7:00 AM:

Use output flag to be xml and no extra parsing needed!

svn log --revision 40:41 svn://some-path --xml


Scott H. on November 04, 2010 at 2:19 PM:

I've searched around google and there are a lot of people presenting this same answer, but I can't believe it works if you have multiple branches or tags open at the same time????

tags/A: rev 10
tags/B: rev 11
tags/A1: rev 12
tags/B1: rev 13

If I just lookup the revision of tags A + A1 and do a log from 10-12, I'll get rev 11 in there as well which was on my B branch and had nothing at all do with the A code line I'm interested in.

Am I missing something?


wallens on November 25, 2016 at 11:28 PM:

This online journal is so pleasant to me. I will continue coming here over and over. Visit my connection too.. navigate to this website


wallens on November 28, 2016 at 7:08 AM:

Wow what a Great Information about World Day its very nice informative post. thanks for the post. Metabolic Syndrome


wallens on December 22, 2016 at 6:34 AM:

Awesome post, and extraordinary site. A debt of gratitude is in order for the data! desapcarl


Post Comments

If you feel like commenting on the above item, use the form below. Your email address will be used for personal contact reasons only, and will not be shown on this website.


Email Address:



Check this box if you hate spam.