darcs

Issue 2423 diff only respecting --diff-command when a diff.exe is present

Title diff only respecting --diff-command when a diff.exe is present
Priority Status resolved
Milestone 2.12.0 Resolved in 2.12.0
Superseder Nosy List alain91, chr.harnisch, eivuokko, jaredj, kirby, wglozer
Assigned To alain91
Topics ProbablyEasy, Windows

Created on 2014-11-30.15:54:39 by chr.harnisch, last changed 2015-06-16.18:13:03 by noreply.

Messages
msg17869 (view) Author: chr.harnisch Date: 2014-11-30.15:54:37
Greetings,

I have found a bug regarding the "darcs diff" command under Windows.
I'm using the binary distribution, so it's version 2.8.1 on a Windows 7
64-bit system.

Problem description:
No matter what options I tried, the diff command would always respond
"darcs failed:  Cannot find the "diff" program.", completely ignoring what
other diff program I wanted to use.

This is what I tried:
- Put "diff diff-command WinDiff %1 %2" (without the quotes) into the
defaults file for the repository
- Put the same line into the global defaults file
- darcs diff --diff-command "WinDiff %1 %2"
- darcs diff --diff-command="..."
- Tried adding the file extension (-> "WinDiff.exe"), tried supplying the
complete path, tried supplying the complete path in 8.3-Format
("C:\Progra~1\...")
- Used variants like 'diff --diff-command ...' or 'diff diff-command
"WinDiff %1 %2"' for the defaults files and command arguments
- Tried using other diff programs: KDiff3 and Meld
- Tried 32-bit and 64-bit variants of KDiff3.
None of these steps had any effect on finding the diff program.

Workaround:
Put a file called "diff.exe" somewhere on PATH. E.g. duplicate any diff
program executable and rename it to diff.exe. "darcs diff" then properly
uses the configured (or passed via --diff-command) program.
For example, darcs diff --diff-command "meld %1 %2" would then properly
result in the message:
Running command 'meld old-second new-second'

Apparently, "darcs diff" first searches for a "diff.exe", and fails if it
can't find it. Only if it can will it actually evaluate what diff program
is configured. In that case, it doesn't even use the diff.exe: A renamed
empty text file works just fine.

Expected behaviour: Search for diff.exe only if nothing else is
configured. If a different diff program is supplied, only use that.


If you need more information, I'm happy to answer your questions.

With kind regards,
Christian Harnisch


P.S.: I'm sending this a second time (cancelled the first message),  
because I forgot to add something I also tried.
msg18401 (view) Author: alain91 Date: 2015-05-09.20:22:21
see patch 1336
msg18521 (view) Author: noreply Date: 2015-06-16.18:13:01
The following patch sent by Ben Franksen <benjamin.franksen@helmholtz-berlin.de> updated issue issue2423 with
status=resolved;resolvedin=2.12.0 HEAD

* resolve issue2423 
Ignore-this: cba962fe999a98d63f4f2a8506218b1
History
Date User Action Args
2014-11-30 15:54:39chr.harnischcreate
2014-11-30 18:52:02ghsettopic: + Windows, ProbablyEasy
nosy: + eivuokko, wglozer, jaredj, kirby
milestone: 2.10.0
2015-04-18 17:39:02ghsetmilestone: 2.10.0 -> 2.12.0
2015-05-09 20:22:23alain91setstatus: unknown -> has-patch
messages: + msg18401
2015-05-09 20:22:38alain91setassignedto: alain91
nosy: + alain91
2015-06-16 18:13:03noreplysetstatus: has-patch -> resolved
messages: + msg18521
resolvedin: 2.12.0