[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

How to svn log across all branches?

From: Luke Adamson <luke_adamson_at_mac.com>
Date: 2006-09-06 08:03:08 CEST

I'd like to see the commit logs for a given file, across _all_
branches of development throughout the life of the repository. This
doesn't appear to be easy (or obvious), and a quick glance through
the source code suggests this may not be possible without lots of
krufty hacking.

Here's my somewhat generalized use case: I want to know, "when was
feature X changed to behave differently?" I know which file is
associated with feature X (say, feature-X.c), and if the developer
who made the change followed protocol, the commit log will contain a
concise description, such as: "Changed feature X to A instead of B,
per someone's request." In theory, all I need to do is "svn log
feature-X.c" and glance through the commit logs until I find
something relevant, at which point I can diff and blame 'till the
cows come home.

_Except_, that in my case, most of the commit messages for feature-
X.c (on the trunk), say things like: "Merging down from branch 123",
and "Merging down from branch 456". With many branches handling
concurrent, overlapping development initiatives over many years,
finding the branch where the change in question was made originally
will be difficult. Deployments are typically done off the head, so
everything trickles there eventually, but the commit messages
associated with those merges don't re-explain every change included
in the merge.

When evaluating "svn log", Subversion appears to be entirely path-
oriented (including the trunk or branch-prefix), such that all
changes logged are only for those on the "current" branch of the file
you're logging. Even if you try logging from revision 0 to head, it
still shows only those changes which were committed on the "current"
branch/path of the file (apologies if my terminology is confusing).

Since branching is merely a cheap copy, and checkouts are piecing
files together from potentially many past branches, I assume
Subversion has an internal file ID associated with each file,
somewhat orthogonal of path. If that's correct, I would expect it
would be easy enough to log all changes associated with a file,
regardless of what branch it was on for the invocation of svn log
(perhaps with some flag to indicate "deep logging").

It's fairly easy to get this (useful) behavior with CVS, so possibly
Subversion supports it and I'm just missing something obvious?

I crawled through the source (first time), and found
svn_repos_get_logs3 (among other related calls), but it seems to be
very path-oriented. It wasn't clear that it could even be extended
to grab histories(?) for all revisions of a file across all branches
upon which it exists (existed).

So, does anyone know if Subversion does what I'm looking for? It all
really boils down to something simple: How do you log what changed on
a file if you're not sure on what branch to go looking for the change
(chicken and egg)?

If not, does anyone know if the underlying architecture would easily
support such an enhancement? I can't imagine how the checkout
process can piece together deltas from ancestor branches without
problems, and yet the logging process has no access to ancestor
branch changes.

Thanks in advance for your suggestions and insight.

---
	Luke
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Wed Sep 6 23:04:06 2006

This is an archived mail posted to the Subversion Users mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.