diff --diff-options argument ignored

Bug #234708 reported by Jelmer Vernooij
6
Affects Status Importance Assigned to Milestone
Bazaar
Fix Released
Low
Matthäus G. Chajdas
bzr (Debian)
Fix Released
Unknown

Bug Description

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

  affects bzr

Reported in Debian, 470006:

Package: bzr
Version: 1.2~rc1-1
Severity: normal

According documentation the argument --diff-options should be passed
to the
external diff program, but they aren't. As shown by the strace output
below

$ strace -f -eexecve bzr diff --using /usr/bin/diff --diff-options -wu
execve("/usr/bin/bzr", ["bzr", "diff", "--using", "/usr/bin/diff",
"--diff-options", "-wu"], [/* 47 vars */]) = 0
=== modified file 'changelog'
Process 8938 attached (waiting for parent)
Process 8938 resumed (parent 8937 ready)
[pid 8938] execve("/usr/bin/diff", ["/usr/bin/diff", "old/changelog",
"new/changelog"], [/* 47 vars */]) = 0

This breaks debcommit when used on a bzr repository :(
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iQCVAwUBSDghewy0JeEGD2blAQJz2AP/YtqvJ6+hcVKkQ4QV4KUUIHTVSQxoNDxf
2ipywOu5I2ABQ4bxw671kuHUP0HhLCN+hcmtV6r2tftr5Lb39aZ+FHORR2M2hE8p
+l/MJ1F1a0wSX2NQ20K5cW/zvgizcWwBoMCYozfPo5FZjwn1G4TMBpQsBn+d8VHs
+C3fp0vG5/U=
=EmKL
-----END PGP SIGNATURE-----

Tags: doc easy

Related branches

Changed in bzr:
status: Unknown → New
Revision history for this message
Aaron Bentley (abentley) wrote : Re: [Bug 234708] [NEW] diff --diff-options argument ignored

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

Jelmer Vernooij wrote:
> According documentation the argument --diff-options should be passed
> to the
> external diff program, but they aren't.

Yes they are.

As you may recall, diff --diff-options has been with us for many years,
and continues to work the same as it always has. It has nothing to do
with --using, except that they are mutually exclusive options.

$ bzr diff --diff-options -c
=== modified file 'baz'
*** baz 2008-05-25 07:31:25 +0000
- --- baz 2008-05-25 07:31:39 +0000
***************
*** 1 ****
! bar
- --- 1 ----
! qux

The --using option already allows command options to be specified, so
there's no reason why it would need to support --diff-options.

$ bzr diff --using 'diff -c'
=== modified file 'baz'
*** old/baz 2008-05-25 03:31:25.000000000 -0400
- --- new/baz 2008-05-25 03:31:39.000000000 -0400
***************
*** 1 ****
! bar
- --- 1 ----
! qux

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

iD8DBQFIORaM0F+nu1YWqI0RArH+AKCFlFCij2o/uGHh7/bmYl9QKcdbRQCbB8zE
SG144SWsSED+E2ugQROPkB0=
=2rVc
-----END PGP SIGNATURE-----

Changed in bzr:
status: New → Confirmed
Revision history for this message
James Westby (james-w) wrote :

Hi,

I'm closing this report at Aaron's suggestion
(Won't FIx as it could be possible to support
both at once)

I'll deal with the Debian bug report.

Thanks,

James

Changed in bzr:
status: New → Won't Fix
Revision history for this message
Jelmer Vernooij (jelmer) wrote :

bzr should error out if both --using and --diff-options are used.

Revision history for this message
Kamil Páral (kamil.paral) wrote :

I reopen this bug. Not only it should print an error when two options are mutually exclusive, but also the documentation should not state quite the opposite:
"--diff-options=ARG Pass these options to the *external* diff program."

Notice the *external* word. It clearly says that this option should be used with conjunction with the --using option to specify external diff's options, not the internal one. The documentation is extremely misleading.

I have just spent 30minutes wondering why the heck my bzr diff doesn't work with external diff correctly. Have I not found this bug by a clear coincidence, I wouldn't have solved it.

Changed in bzr:
status: Won't Fix → New
Vincent Ladeuil (vila)
Changed in bzr:
status: New → Confirmed
importance: Undecided → Low
tags: added: doc easy
Revision history for this message
John Szakmeister (jszakmeister) wrote :

This just bit me too. It's very unclear that --using and --diff-options are unrelated.

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

I think we should definitely at least give an error.

I don't see why insisting on '--using cdiff --diff-options -x' is actually helping anyone. Perhaps if both are given, the options should be appended to the command line. --using could come from a configuration option or alias but the user may wish to give more options.

Martin Pool (mbp)
Changed in bzr:
status: Confirmed → In Progress
Vincent Ladeuil (vila)
Changed in bzr:
assignee: nobody → Matthäus G. Chajdas (anteru)
status: In Progress → Fix Released
milestone: none → 2.3b1
Changed in bzr (Debian):
status: Confirmed → Fix Released
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.