summaryrefslogtreecommitdiff
path: root/git-mergetool.sh
diff options
context:
space:
mode:
authorDenton Liu <liu.denton@gmail.com>2018-10-24 16:25:31 (GMT)
committerJunio C Hamano <gitster@pobox.com>2018-10-25 05:01:10 (GMT)
commit063f2bdbf767dd24bc0a35b5476d8025ee8646c7 (patch)
tree98d9c98da418e0193b7c541b191af809529e9264 /git-mergetool.sh
parentc4df23f7927d8d00e666a3c8d1b3375f1dc8a3c1 (diff)
downloadgit-063f2bdbf767dd24bc0a35b5476d8025ee8646c7.zip
git-063f2bdbf767dd24bc0a35b5476d8025ee8646c7.tar.gz
git-063f2bdbf767dd24bc0a35b5476d8025ee8646c7.tar.bz2
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-xgit-mergetool.sh11
1 files changed, 9 insertions, 2 deletions
diff --git a/git-mergetool.sh b/git-mergetool.sh
index d07c7f3..01b9ad5 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