2 "$merge_tool_path" "$LOCAL" "$REMOTE"
6 check_meld_for_features
9 if test "$meld_use_auto_merge_option" = true
11 option_auto_merge="--auto-merge"
14 if test "$meld_has_output_option" = true
16 "$merge_tool_path" $option_auto_merge --output="$MERGED" \
17 "$LOCAL" "$BASE" "$REMOTE"
19 "$merge_tool_path" $option_auto_merge "$LOCAL" "$MERGED" "$REMOTE"
23 # Get meld help message
24 init_meld_help_msg () {
25 if test -z "$meld_help_msg"
27 meld_path="$(git config mergetool.meld.path || echo meld)"
28 meld_help_msg=$("$meld_path" --help 2>&1)
32 # Check the features and set flags
33 check_meld_for_features () {
34 # Check whether we should use 'meld --output <file>'
35 if test -z "$meld_has_output_option"
37 meld_has_output_option=$(git config --bool mergetool.meld.hasOutput)
38 case "$meld_has_output_option" in
40 : use configured value
43 : empty or invalid configured value, detecting "--output" automatically
46 case "$meld_help_msg" in
47 *"--output="* | *'[OPTION...]'*)
48 # All version that has [OPTION...] supports --output
49 meld_has_output_option=true
52 meld_has_output_option=false
58 # Check whether we should use 'meld --auto-merge ...'
59 if test -z "$meld_use_auto_merge_option"
61 meld_use_auto_merge_option=$(
62 git config --bool-or-str mergetool.meld.useAutoMerge
64 case "$meld_use_auto_merge_option" in
66 : use well formatted boolean value
69 # testing the "--auto-merge" option only if config is "auto"
72 case "$meld_help_msg" in
73 *"--auto-merge"* | *'[OPTION...]'*)
74 meld_use_auto_merge_option=true
77 meld_use_auto_merge_option=false
82 meld_use_auto_merge_option=false
85 die "unknown mergetool.meld.useAutoMerge: $meld_use_auto_merge_option"