File tree Expand file tree Collapse file tree 2 files changed +16
-2
lines changed Expand file tree Collapse file tree 2 files changed +16
-2
lines changed Original file line number Diff line number Diff line change @@ -1754,6 +1754,15 @@ mergetool.<tool>.trustExitCode::
1754
1754
if the file has been updated, otherwise the user is prompted to
1755
1755
indicate the success of the merge.
1756
1756
1757
+ mergetool.meld.hasOutput::
1758
+ Older versions of `meld` do not support the `--output` option.
1759
+ Git will attempt to detect whether `meld` supports `--output`
1760
+ by inspecting the output of `meld --help`. Configuring
1761
+ `mergetool.meld.hasOutput` will make Git skip these checks and
1762
+ use the configured value instead. Setting `mergetool.meld.hasOutput`
1763
+ to `true` tells Git to unconditionally use the `--output` option,
1764
+ and `false` avoids using `--output`.
1765
+
1757
1766
mergetool.keepBackup::
1758
1767
After performing a merge, the original file with conflict markers
1759
1768
can be saved as a file with a `.orig` extension. If this variable
Original file line number Diff line number Diff line change @@ -18,13 +18,18 @@ merge_cmd () {
18
18
check_unchanged
19
19
}
20
20
21
- # Check whether 'meld --output <file>' is supported
21
+ # Check whether we should use 'meld --output <file>'
22
22
check_meld_for_output_version () {
23
23
meld_path="$(git config mergetool.meld.path)"
24
24
meld_path="${meld_path:-meld}"
25
25
26
- if "$meld_path" --help 2>&1 | grep -e --output >/dev/null
26
+ if meld_has_output_option=$(git config --bool mergetool.meld.hasOutput)
27
27
then
28
+ : use configured value
29
+ elif "$meld_path" --help 2>&1 |
30
+ grep -e '--output=' -e '\[OPTION\.\.\.\]' >/dev/null
31
+ then
32
+ : old ones mention --output and new ones just say OPTION...
28
33
meld_has_output_option=true
29
34
else
30
35
meld_has_output_option=false
You can’t perform that action at this time.
0 commit comments