Skip to content

Commit 759a904

Browse files
jrngitster
authored andcommitted
mergetools/meld: Use --help output to detect --output support
In v1.7.7-rc0~3^2 (2011-08-19), git mergetool's "meld" support learned to use the --output option when calling versions of meld that are detected to support it (1.5.0 and newer, hopefully). Alas, it misdetects old versions (before 1.1.5, 2006-06-11) of meld as supporting the option, so on systems with such meld, instead of getting a nice merge helper, the operator gets a dialog box with the text "Wrong number of arguments (Got 5)". (Version 1.1.5 is when meld switched to using optparse. One consequence of that change was that errors in usage are detected and signalled through the exit status even when --help was passed.) Luckily there is a simpler check that is more reliable: the usage string printed by "meld --help" reliably reflects whether --output is supported in a given version. Use it. Reported-by: Jeff Epler <[email protected]> Signed-off-by: Jonathan Nieder <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 703f05a commit 759a904

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

mergetools/meld

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ check_meld_for_output_version () {
2323
meld_path="$(git config mergetool.meld.path)"
2424
meld_path="${meld_path:-meld}"
2525

26-
if "$meld_path" --output /dev/null --help >/dev/null 2>&1
26+
if "$meld_path" --help 2>&1 | grep -e --output >/dev/null
2727
then
2828
meld_has_output_option=true
2929
else

0 commit comments

Comments
 (0)