[MERGE] Implement a --diff-command option for bzr diff.

Nicholas Allen allen at ableton.com
Wed Aug 29 11:26:26 BST 2007

Stephen Ward wrote:
> On Monday 27 August 2007 12:18:17 pm Nicholas Allen wrote:
>> I think it would be nice to have the option to run a diff command
>> though. You can solve those problems by using a command pattern (eg
>> %FROM, %TO would get substituted with the from and to file names).
>> So you could do: diff --diff-command "beyondcompare.exe %TO %FROM"
>> This would be more flexible than diff tools as this needs code for each
>> kind of viewer (which is also nice). So I just think it would be great
>> to have in built support for many diff viewers (like difftools does) as
>> well as totally flexible commands like above.
> The reason why difftools takes the code approach, and not just a command 
> pattern (like extmerge) is that there are bigger differences than just the 
> order of arguments.  Some tools (kompare, meld, kdiff3) work best if you give 
> them the whole set of files at once, while others (vimdiff, tkdiff, mgdiff) 
> prefer to be invoked once per file.  It all depends on whether the diff tool 
> thinks *it* is in control.
> I'm sure it *could* still be done with a command pattern, but it would have to 
> be fancier than "%FROM %TO" (and correspondingly harder for users to 
> understand/remember) if it really provided the flexibility required.
> -- Steve
I agree. But I was saying that it makes sense to have *both* the code 
approach and flexible commands. With the flexible commands you have the 
disadvantage that it will invoke the command for every file that changed 
but in many cases this is ok. If not then you are right the code 
approach is better. Just because the flexible command cannot satisfy 
every single use case does not mean it would not be a useful feature to 
have as well. There are many graphical file diff viewers that just take 
2 file names as arguments and all of these could then be easily 
supported by bzr without any extra code. I don't think it is reasonable 
to expect bzr to have special code for every diff viewer that exists or 
will exist in the future.


More information about the bazaar mailing list