git@vger.kernel.org list mirror (unofficial, one of many)
 help / color / mirror / code / Atom feed
8386e0574edfe317d20a15ef09edbcf73abc5d81 blob 1991 bytes (raw)

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
 
diff_cmd () {
	"$merge_tool_path" "$LOCAL" "$REMOTE"
}

merge_cmd () {
	check_meld_for_features

	option_auto_merge=
	if test "$meld_use_auto_merge_option" = true
	then
		option_auto_merge="--auto-merge"
	fi

	if test "$meld_has_output_option" = true
	then
		"$merge_tool_path" $option_auto_merge --output="$MERGED" \
			"$LOCAL" "$BASE" "$REMOTE"
	else
		"$merge_tool_path" $option_auto_merge "$LOCAL" "$MERGED" "$REMOTE"
	fi
}

# Get meld help message
init_meld_help_msg () {
	if test -z "$meld_help_msg"
	then
		meld_path="$(git config mergetool.meld.path || echo meld)"
		meld_help_msg=$("$meld_path" --help 2>&1)
	fi
}

# Check the features and set flags
check_meld_for_features () {
	# Check whether we should use 'meld --output <file>'
	if test -z "$meld_has_output_option"
	then
		meld_has_output_option=$(git config --bool mergetool.meld.hasOutput)
		case "$meld_has_output_option" in
		true | false)
			: use configured value
			;;
		*)
			: empty or invalid configured value, detecting "--output" automatically
			init_meld_help_msg

			case "$meld_help_msg" in
			*"--output="* | *'[OPTION...]'*)
				# All version that has [OPTION...] supports --output
				meld_has_output_option=true
				;;
			*)
				meld_has_output_option=false
				;;
			esac
			;;
		esac
	fi
	# Check whether we should use 'meld --auto-merge ...'
	if test -z "$meld_use_auto_merge_option"
	then
		meld_use_auto_merge_option=$(
			git config --type=bool-or-str mergetool.meld.useAutoMerge
		)
		case "$meld_use_auto_merge_option" in
		true | false)
			: use well formatted boolean value
			;;
		auto)
			# testing the "--auto-merge" option only if config is "auto"
			init_meld_help_msg

			case "$meld_help_msg" in
			*"--auto-merge"* | *'[OPTION...]'*)
				meld_use_auto_merge_option=true
				;;
			*)
				meld_use_auto_merge_option=false
				;;
			esac
			;;
		"")
			meld_use_auto_merge_option=false
			;;
		*)
			die "unknown mergetool.meld.useAutoMerge: $meld_use_auto_merge_option"
			;;
		esac
	fi
}
debug log:

solving 8386e0574e ...
found 8386e0574e in https://public-inbox.org/git/patch-3.6-8aa59b3118-20210408T133125Z-avarab@gmail.com/
found aab4ebb935 in git.git.git
preparing index
index prepared:
100644 aab4ebb9355ae946f1c7b289569f1892ea29e583	mergetools/meld

applying [1/1] https://public-inbox.org/git/patch-3.6-8aa59b3118-20210408T133125Z-avarab@gmail.com/
diff --git a/mergetools/meld b/mergetools/meld
index aab4ebb935..8386e0574e 100644

Checking patch mergetools/meld...
Applied patch mergetools/meld cleanly.

index at:
100644 8386e0574edfe317d20a15ef09edbcf73abc5d81	mergetools/meld

Code repositories for project(s) associated with this inbox:

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).