wishlist: please add --xml option to log command (for GNU changelog support)

Bug #29582 reported by Arthur de Jong
8
Affects Status Importance Assigned to Milestone
Bazaar
Fix Released
Wishlist
Unassigned

Bug Description

I use an xslt stylesheet to generate a GNU style ChangeLog from svn log --xml (http://ch.tudelft.nl/~arthur/svn2cl/). It would be nice if bzr would output similar xml from the subversion format (maybe with some extra fields).

(I haven't really used bzr yet in any development but I just thought this would be a good idea and more or less a requirement for my projects)

Revision history for this message
Martin Pool (mbp) wrote :

Would be nice, and should be easy to plug into the log format framework.

Changed in bzr:
status: Unconfirmed → Confirmed
Revision history for this message
Arthur de Jong (adejong) wrote :

I'm more than happy to try to add support for output from bzr to svn2cl if the xml format is similar enough to the svn format. I'm not very familiar with bzr yet so I don't think I can contribute too much on the bzr end at this time.

Revision history for this message
Jo Vermeulen (jozilla) wrote :

Why not just generate a GNU style ChangeLog directly? What is the current status of such a feature? Is it implemented, or still open? Might be a useful plugin...

Revision history for this message
John A Meinel (jameinel) wrote :

James Westby has actually done some nice work on refactoring the internals to make supporting advanced log formatters easier. (One of the things with an XML formatter is that it needs an event when you are finished so that it can emit the closing tag).

I would guess that emitting a GNU style Changelog would actually be fairly simple, but I don't know all the details of the format. Probably it would be simpler to implement a 'bzr log --log-format=changelog' than xml, but we would like to have an xml format anyway.

Changed in bzr:
assignee: nobody → jw+debian
Revision history for this message
Wouter van Heyst (larstiq) wrote : Re: [Bug 29582] Re: wishlist: please add --xml option to log command

On Thu, Jan 18, 2007 at 11:51:57PM -0000, John A Meinel wrote:
> James Westby has actually done some nice work on refactoring the
> internals to make supporting advanced log formatters easier. (One of the
> things with an XML formatter is that it needs an event when you are
> finished so that it can emit the closing tag).
>
> I would guess that emitting a GNU style Changelog would actually be
> fairly simple, but I don't know all the details of the format. Probably
> it would be simpler to implement a 'bzr log --log-format=changelog' than
> xml, but we would like to have an xml format anyway.

For the record, http://bazaar-vcs.org/BzrPlugins already lists gnulog:
    http://telecom.inescporto.pt/~gjc/gnulog.py

Which basically works, althought it seems to have some unicode problems
on bzr.dev

Wouter van Heyst

Revision history for this message
Jo Vermeulen (jozilla) wrote : Re: wishlist: please add --xml option to log command

Oh, I just started working on a ChangelogFormatter, which works as well (in a very basic version) :-) I don't know what you guys prefer? An integrated version or a plugin?

What about the unicode problems by the way, isn't this handled by Python and bzrlib themselves?

Revision history for this message
Jo Vermeulen (jozilla) wrote :

What seems to be lacking in the plugin as far as I can see is the logging of files.

You would expect something like:

2007-01-19 Jo Vermeulen <email address hidden>
    * bzrlib/log.py: Added support for GNU Changelog format.

The plugin currently gives:

2007-01-19 Jo Vermeulen <email address hidden>
    * [32]: Added support for GNU Changelog format.

Although it seems the code for handling this is present. Maybe should have a look at how bzr visualize does this...

Revision history for this message
John A Meinel (jameinel) wrote :

In general, inside bzrlib we use Unicode.

But at some point you have to convert Unicode to some sort of 8-bit encoding when writing to disk or displaying to a user.

If gnulog.py is writing directly to the screen (which is fairly likely) it may not understand what encoding it needs to write in.

I don't have any experience with the plugin. I just have a lot of experience with trying to get encoding/decoding to work properly on different platforms. (win32 and osx do some weird things sometimes)

Revision history for this message
Wouter van Heyst (larstiq) wrote : Re: [Bug 29582] Re: wishlist: please add --xml option to log command

On Fri, Jan 19, 2007 at 05:26:40PM -0000, Jo Vermeulen wrote:
> Oh, I just started working on a ChangelogFormatter, which works as well
> (in a very basic version) :-) I don't know what you guys prefer? An
> integrated version or a plugin?

My gut feeling is that a GNU style changelog formatter has a limited
audience.

> What about the unicode problems by the way, isn't this handled by Python
> and bzrlib themselves?

Alas, python and bzrlib are not magic :) I'll take a look at what
exactly the problem is.

Wouter van Heyst

Revision history for this message
Jo Vermeulen (jozilla) wrote : Re: wishlist: please add --xml option to log command

Okay, I'll leave it to the plugin then :-)

Revision history for this message
Aaron Bentley (abentley) wrote : Re: [Bug 29582] Re: wishlist: please add --xml option to log command

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Jo Vermeulen wrote:
> Okay, I'll leave it to the plugin then :-)

Just because it's a plugin doesn't mean it has to be a command. Do it
as a log formatter plugin. That's much nicer than making a new command
for it, because that way, it works with any command that supports logs.

Aaron

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.3 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFFsWPC0F+nu1YWqI0RAuqTAJ4ryankgucl/Rjza6pnm9tl4Wl6WQCdE7mG
GPU0DCRVOY1+gfTBdhQ9rII=
=T82M
-----END PGP SIGNATURE-----

Revision history for this message
James Westby (james-w) wrote : Re: wishlist: please add --xml option to log command

Hi,

Doe the xmloutput plugin actually do this?

Thanks,

James

Changed in bzr:
assignee: james-w → nobody
Revision history for this message
Guillermo Gonzalez (verterok) wrote :

James,
    You are right, the current xmloutput version 0.4.x do this, but in the near future is going to be removed in favor of a standalone command, i.e: xmllog. Mainly because the current implementation replace the builtin log command.

Cheers,

Revision history for this message
James Westby (james-w) wrote :

Hi Guillermo,

DO you realise that a plugin can provide a log formatter so that
bzr log --format=xml will work? I added enough to the log formatters
to make xml possible with that framework.

The xmllog command if still needed could be an alias then.

Thanks,

James

Revision history for this message
Guillermo Gonzalez (verterok) wrote :

Hi James,
    Sure, it's implemented in that way :)
    I just wrote a reply too quickly :P
    I get confused, because other commands implemented in xmloutput do that, and in previous versions of xmloutput the log command was replaced with a "xml aware" one, mainly for the reasons explained by john: "One of the things with an XML formatter is that it needs an event when you are finished so that it can emit the closing tag".
    But I fixed this in the current XMLLogFormatter implementation.
    So it's safe to say that 'log --xml' is going to be part of future xmloutput versions.
    Apologize me for the misunderstood (and the noise) :)

Cheers,

Revision history for this message
James Westby (james-w) wrote : Re: [Bug 29582] Re: wishlist: please add --xml option to log command

On Tue, 2008-06-17 at 16:38 +0000, Guillermo Gonzalez wrote:
> Hi James,
> Sure, it's implemented in that way :)
> I just wrote a reply too quickly :P
> I get confused, because other commands implemented in xmloutput do that, and in previous versions of xmloutput the log command was replaced with a "xml aware" one, mainly for the reasons explained by john: "One of the things with an XML formatter is that it needs an event when you are finished so that it can emit the closing tag".
> But I fixed this in the current XMLLogFormatter implementation.
> So it's safe to say that 'log --xml' is going to be part of future xmloutput versions.
> Apologize me for the misunderstood (and the noise) :)

No problem, just wanted to make sure you hadn't missed it.

Thanks,

James

Revision history for this message
Andrea Bolognani (kiyuko) wrote : Re: wishlist: please add --xml option to log command

Hi,

I've written a quick and dirty LogFormatter which outputs GNU-style ChangeLogs.

It would probably be best implemented as a plugin, but I'm not confident enough with bzrlib yet to use the plugin system. Also, I think having this functionality built-in would be nice.

The current implementation works fine with both ChangeLog-formatted commit messages (best results, but more work, and doesn't look good if you're using other log formatters) and plain messages; in the latter case, you have to use --verbose to have the list of paths involved in the change at the beginning of the ChangeLog entry.

Feel free to rework the code if needed.

Revision history for this message
Martin Pool (mbp) wrote : Re: [Bug 29582] Re: wishlist: please add --xml option to log command

Hi Andrea,

Thankyou for the patch.

Would you please execute the copyright document at
http://bazaar-vcs.org/CopyrightAssignment and mail it to me so that we
can merge this patch?

I'll add a smoke test in https://code.launchpad.net/~mbp/bzr/gnu-changelog

--
Martin <http://launchpad.net/~mbp/>

Revision history for this message
Robert Collins (lifeless) wrote :

We have the gnu changelog included, and xmloutput does its thing, so this bug is covered every which way.

Changed in bzr:
status: Confirmed → Fix Released
summary: - wishlist: please add --xml option to log command
+ wishlist: please add --xml option to log command (for GNU changelog
+ support)
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.