tags:

views:

222

answers:

3

Is there any way to configure doxygen to include the log from svn for a file as part of the output. Basically we enter pretty rigorous log messages into svn when we do commits, and I'd like those messages to have a section inside the doxygen output.

+1  A: 

How about using a build server (CruiseControl/Bamboo/TeamCity etc)? The build server would monitor svn for changes, and the build script (for example ant) calls Doxygen as part of the build. I use this arrangement at work on a Java and C# combined build. The build script can pick up the latest commit message using "svn log" with appropriate options.

phlip
+2  A: 

I don't know a simple or easy solution for this but I think you can quickly hack something together.

  • First you can generate a HTML file from the SVN log using the svn2html.xsl stylesheet from the svn2cl tool. If you don't like it it's actually not difficult to write something like that as you can read in this blog post.
  • Second you could somehow modify the Doxygen output to include a link to the html file generated in step one. I don't know much about that but maybe the doxygen manual page about customization is a good start.
  • Third you could write a small build file for your documentation that automates step one and two possibly using make or a shell script or a batch file.

Not very elegant but a start.

Sebastian
+1 I think we were thinking along similar lines, I would attempt to batch up the changes too.
amelvin
I basically used exactly your answer, however it required a bit of manual labour to link the outputted doxygen to the svn(it didnt seem like there was an automated way to do this). You can insert links inside your comments in doxygen so each individual file contains a link to the generated log file(its a bit error prone, and would be complicated if any of the files had duplicate names in the subdirs). Looping through all the files to generate an svn log and then running doxygen is all through a simple shell script.
Medran
Also looking into the page about customization you posted im sure it would be possible to write some kind of program to use the xml output option from doxygen to automatically create the links between the svn output and the doxygen output, but this seemed like far too much work.
Medran
A: 

I like the idea, but surely it would only work if you only committed SVN a file at a time - or the doxygen output would be littered with irrelevant comments?

I think it can be done using a batch update of SVN commits.

You can extract the SVN commits which will show the files committed and the change comments made by opening the SVN logfile. So I reckon you could write a windows service or cron job that would nightly build a list of files changed and their comments by running round the logfile and building up a Dictionary or HashTable. With that in place have the cron/win service open each file mentioned, search for the end of the description section:

* @section DESCRIPTION 
* 
*  
*
**/

and place the comment within this section.

amelvin
well, I suppose its possible it could be littered but we try and do commits per task, so 1 or 2 line comments which would apply to the entire commit.
Medran