SVN Commit stats: Having the cake and eating it, too

Avatar

Pekka Gaiser

4 months ago

I have worked freelance on a project for a company who have generously allowed me to publish the project as open source. There is a SVN repository that has quite a long commit history, almost a year's work with hundreds of beautiful commits. The catch is that the versions in this repository contain several modules that will not be published as open source, and files that contain company-internal paths, generic passwords, and the like - no grave security risks but still awkward to have in a public repository.

If I export the repository into a new one, and strip it from all company-specific modules and settings, ohloh will warn that the project has a very short commit history - quite unjustly. Most of the work is done, the project is very mature, so it could be that there will not be much development commit-wise in the next few months. Still, the project is healthy and fresh, and I would really like to have these stats counted.

Is there any way to have the commit statistics counted, but the company-internal parts protected? Any ideas from the SVN camp, possibly?


Avatar

jpike

4 months ago

svnadmin dump | svndumpfilter exclude {space seperated list of path prefixes to exlude} > newdump


Avatar

jpike

4 months ago

Sorry I forgot svnadmin dump must also take the repository argument.. here's the full command:

svnadmin dump | svndumpfilter exclude {space separated prefixes to exclude} | svnadmin load


Avatar

jpike

4 months ago

Imagine {repository} after dump and load, I didn't realise ohloh would filter the < and >. I apologise for all of the replies.


Avatar

Pekka Gaiser

4 months ago

Looks great, I didn't know about the svndumpfilter tool. Will try in the next couple of days and post the results here. Thanks very much!


Avatar

Aristid Breitkreuz

4 months ago

Or you could export to git and use git filter-branch to remove the offending files, which would preserve the depth of the history. :-)


Avatar

jpike

4 months ago

I would also recommend Aristid's idea,

Svn is looking really old now, distributed version control systems are the future.