[ANN][PLUGIN] graphical diff using kompare

Martin Pool mbp at sourcefrog.net
Thu Apr 27 01:35:34 BST 2006


On 26/04/2006, at 10:40 PM, Stephen Ward wrote:

> On Wednesday 26 April 2006 01:21, Martin Pool wrote:
>> This looks nice.  I agree it would be good to unify the various
>> external diff/merge things - there may need to be some per-tool
>> intelligence about whether it can do tree diffs, etc.
>
> Agreed.
>
> Is there any way for a plugin to add a new option to an existing  
> command,
> rather than adding a new command?  For example:
>
>   bzr diff --using kdiff3 [OPTIONS] [FILES*]
>
> Or would that have to be done with a patch to bzrlib itself?

As John says, you *can* do it by providing a new definition of  
cmd_diff that calls the one from bzrlib.builtins.cmd_diff.  However I  
think that option would be entirely appropriate to be in the core, so  
please write it as a patch to bzr instead.

I suggest that by default what's given there should be just treated  
as a command name that can be run as

   $cmd $file1 $file2

but have a registration mechanism that can provide more information  
about a particular command - extra arguments to pass, how to diff  
multiple files or whole trees, etc.

>> When I run this for a whole-tree diff, it shows diffs within .bzr as
>> well.   I can add that to the ignore list but is there any way the
>> plugin can arrange for it to be automatically hidden?
>
> I'm sure that this could be done, but the ignore-list mechanisms  
> are extremely
> tool-specific (and in most cases, not designed for use from the  
> command
> line), so there would be a fair amount of code involved.  I'm  
> generally
> reluctant to go messing with other application's config files.
>
> For the moment, I've just settled for mentioning the need for this  
> sort of
> tool-specific configuration in the help text and the README.

Fair enough.

-- 
Martin







More information about the bazaar mailing list