External diff support assumes --binary exists

Bug #1732705 reported by Matthew Fuller
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Bazaar
New
Undecided
Unassigned
Breezy
Triaged
Medium
Jelmer Vernooij

Bug Description

External diff unconditionally puts --binary on the command line, which is a GNU diff extension not necessarily present on other diff(1) implementations. It seems to have been added in r1711.2.56, but the commit log is silent on why.

Jelmer Vernooij (jelmer)
Changed in brz:
status: New → Triaged
importance: Undecided → Medium
tags: added: diff
Jelmer Vernooij (jelmer)
tags: added: exernal-diff
Revision history for this message
Vincent Ladeuil (vila) wrote (last edit ):

o/

This breaks macos (ventura at least) because apple provides its own diff:

  bash-3.2$ diff --version
  Apple diff (based on FreeBSD diff)

... which doesn't support --binary ... sighs

Is there any known workaround ?
Breezy doesn't have an internal diff anymore ?

Revision history for this message
Jelmer Vernooij (jelmer) wrote : Re: [Bug 1732705] Re: External diff support assumes --binary exists

On Thu, Nov 03, 2022 at 03:44:29PM -0000, Vincent Ladeuil wrote:
> o/
>
> This breaks macos ventura because apple provides its own diff:
>
> bash-3.2$ diff --version
> Apple diff (based on FreeBSD diff)
>
> ... which doesn't support --binary ... sighs
>
> Is there any known workaround ?
> Breezy doesn't have an internal diff anymore ?
>

We haven't removed the internal diff, so that should still work. Does "bzr
diff" not default to the internal one?

Jelmer

Revision history for this message
Vincent Ladeuil (vila) wrote :

Hmm, when used directly it does.

The failing use case is:

  brz diff --diff-options -u .

which triggers the external diff defaulting to the one in PATH.

For whatever reason I'm running into this from emacs vc handling on macos but not on ubuntu...

Revision history for this message
Matthew Fuller (fullermd) wrote :

Well, on ubuntu, it'd be GNU diff, wouldn't it? :)

I've traditionally worked around this by specifying --using as well; if you tell it the diff program, it didn't pretend it knew to add any arguments other than those you specify.

In 3.2 releases and branch, it's further broken due to bug 1977988 breaking --diff-options more generally...

Revision history for this message
Vincent Ladeuil (vila) wrote :

> Well, on ubuntu, it'd be GNU diff, wouldn't it? :)

/me facepalms

Yes of course, verified.

Revision history for this message
Vincent Ladeuil (vila) wrote :

Epilog: emacs can be taught that -u is the breezy diff default format anyway so emacs "'diff-switches" should not default to "-u" but to nil.

So my side of the issue (a subset of this bug) has a workaround at least.

Revision history for this message
Jelmer Vernooij (jelmer) wrote :

On Fri, Nov 04, 2022 at 10:20:35AM -0000, Vincent Ladeuil wrote:
> Epilog: emacs can be taught that -u is the breezy diff default format
> anyway so emacs "'diff-switches" should not default to "-u" but to nil.
>
> So my side of the issue (a subset of this bug) has a workaround at
> least.

Thanks for the update!

Jelmer Vernooij (jelmer)
Changed in brz:
assignee: nobody → Jelmer Vernooij (jelmer)
milestone: none → 3.3.1
Jelmer Vernooij (jelmer)
Changed in brz:
milestone: 3.3.1 → 3.3.2
Jelmer Vernooij (jelmer)
Changed in brz:
milestone: 3.3.2 → none
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.