[MERGE] Implement diff --using natively

Robert Collins robertc at robertcollins.net
Fri Dec 28 18:36:46 GMT 2007


On Fri, 2007-12-28 at 10:30 -0500, Aaron Bentley wrote:
> Robert Collins wrote:
> > On Thu, 2007-12-27 at 22:50 -0500, Aaron Bentley wrote:
> > 
> >>> - (possibly) tool does not accept options
> >> How would you detect this?  Exit codes?  I don't know if there's enough
> >> regularity for that.  For example, gvimdiff produces exit code 1 when
> >> given bad options, but for diff, exit code 1 means "files are different".
> > 
> > Something like that. A better question perhaps is
> > 'How will we tell that the tool failed and the user did not get their
> > diff?'
> 
> I don't think we can do that reliably.
> 
> > Perhaps requiring that the tool emit 'gnu diff' exit codes is
> > reasonable?
> 
> I don't think so.  I want this to work with any arbitrary tool that can
> be invoked as "COMMAND [ARGS] file1 file2".  But it might be safe to
> work *best* with tools that emulate gnu diff, and assume exit code 2
> indicates failure, without assuming that 0 or 1 indicate success.

Isn't GNU diff
0 - no change
1 - change
2 - unrepresentable change
other - error

I'm inclined to prefer that users have a wrapper script for arbitrary
tools so that we can rely on exit codes. 

> > Oh, it looked like they did. If they don't actually run an external tool
> > then never mind (but how can you tell it's working ? :))
> 
> The external tool I run is Python.  I figure they probably have that :-)

Ah right. You might have some issues on windows though unless your
command is literally 'python file1 file2' in which case I can imagine
strange things happening anyway ;).

-Rob
-- 
GPG key available at: <http://www.robertcollins.net/keys.txt>.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20071229/5c91b152/attachment.pgp 


More information about the bazaar mailing list