diff options
author | Denton Liu <liu.denton@gmail.com> | 2018-10-24 12:25:31 -0400 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2018-10-25 14:01:10 +0900 |
commit | 063f2bdbf767dd24bc0a35b5476d8025ee8646c7 (patch) | |
tree | 98d9c98da418e0193b7c541b191af809529e9264 /git-mergetool.sh | |
parent | c4df23f7927d8d00e666a3c8d1b3375f1dc8a3c1 (diff) | |
download | git-063f2bdbf767dd24bc0a35b5476d8025ee8646c7.tar.gz |
mergetool: accept -g/--[no-]gui as arguments
In line with how difftool accepts a -g/--[no-]gui option, make mergetool
accept the same option in order to use the `merge.guitool` variable to
find the default mergetool instead of `merge.tool`.
Signed-off-by: Denton Liu <liu.denton@gmail.com>
Signed-off-by: Anmol Mago <anmolmago@gmail.com>
Signed-off-by: Brian Ho <briankyho@gmail.com>
Signed-off-by: David Lu <david.lu97@outlook.com>
Signed-off-by: Ryan Wang <shirui.wang@hotmail.com>
Acked-by: David Aguilar <davvid@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'git-mergetool.sh')
-rwxr-xr-x | git-mergetool.sh | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/git-mergetool.sh b/git-mergetool.sh index d07c7f387c..01b9ad59b2 100755 --- a/git-mergetool.sh +++ b/git-mergetool.sh @@ -9,7 +9,7 @@ # at the discretion of Junio C Hamano. # -USAGE='[--tool=tool] [--tool-help] [-y|--no-prompt|--prompt] [-O<orderfile>] [file to merge] ...' +USAGE='[--tool=tool] [--tool-help] [-y|--no-prompt|--prompt] [-g|--gui|--no-gui] [-O<orderfile>] [file to merge] ...' SUBDIRECTORY_OK=Yes NONGIT_OK=Yes OPTIONS_SPEC= @@ -389,6 +389,7 @@ print_noop_and_exit () { main () { prompt=$(git config --bool mergetool.prompt) + gui_tool=false guessed_merge_tool=false orderfile= @@ -414,6 +415,12 @@ main () { shift ;; esac ;; + --no-gui) + gui_tool=false + ;; + -g|--gui) + gui_tool=true + ;; -y|--no-prompt) prompt=false ;; @@ -443,7 +450,7 @@ main () { if test -z "$merge_tool" then # Check if a merge tool has been configured - merge_tool=$(get_configured_merge_tool) + merge_tool=$(get_configured_merge_tool $gui_tool) # Try to guess an appropriate merge tool if no tool has been set. if test -z "$merge_tool" then |