git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: A note on modern git plus ancient meld ("wrong number of arguments")

From
Junio C Hamano <gitster@pobox.com>
Date
Feb 10, 2012, 21:28 UTC
Message-ID
<7vwr7unzs8.fsf@alter.siamese.dyndns.org>
In-Reply-To
<20120210082106.GA7871@burratino>
Jonathan Nieder <jrnieder@gmail.com> 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
}
Previous: Jonathan NiederNext: Jonathan Nieder
Message 6 of 9 in “A note on modern git plus ancient meld ("wrong number of arguments")”
  1. Jeff EplerFeb 9, 2012
  2. David AguilarFeb 10, 2012
  3. Jonathan NiederFeb 10, 2012
  4. Sebastian SchuberthFeb 10, 2012
  5. Jonathan NiederFeb 10, 2012
  6. Junio C HamanoFeb 10, 2012
  7. mergetools/meld: Use --help output to detect --output supportJonathan Nieder, Feb 10, 2012
  8. Jeff EplerFeb 10, 2012
  9. Jeff EplerFeb 10, 2012

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.