From: Junio C Hamano Date: Fri, 10 Feb 2012 21:28:55 GMT Subject: Re: A note on modern git plus ancient meld ("wrong number of arguments") Message-ID: <7vwr7unzs8.fsf@alter.siamese.dyndns.org> In-Reply-To: <20120210082106.GA7871@burratino> Jonathan Nieder writes: > Just parse version numbers instead. We can detect the version number > by running "meld --version" and postprocessing it. Hmm. I am debating myself if it may be more efficient, less error prone and simpler for the users if we gave them "mergetool.meld.useOutput" configuration option to tweak. When an older meld fails when given --output for real (not with the dry run current code tries with --help), can we sanely detect that particular failure? If we can do so, another possibility may be to do something like this: merge_cmd () { meld_has_output_option=$(git config --bool mergetool.meld.useOutput) case "$meld_has_output_option" in false) ... do the non-output thing ... ;; true) "$merge_tool_path" --output "$MERGED" "$LOCAL" "$BASE" "$REMOTE" ;; *) "$merge_tool_path" --output "$MERGED" "$LOCAL" "$BASE" "$REMOTE" if it failed due to missing --output support? then meld_has_output_option=no git config mergetool.meld.useOutput false merge_cmd fi ;; esac }