X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=git-difftool--helper.sh;h=e6558d101062929241cc30cd0272556c3164310b;hb=dbdc07fcbe3a951df8a3869b42edb6fffd466486;hp=524f5ea8ab14bb44e5a8e6393e40c0ec5c1ddaa2;hpb=c444c16589f95ac22d8e3ffe603cd7f0613512ce;p=git.git diff --git a/git-difftool--helper.sh b/git-difftool--helper.sh index 524f5ea8a..e6558d101 100755 --- a/git-difftool--helper.sh +++ b/git-difftool--helper.sh @@ -13,7 +13,8 @@ TOOL_MODE=diff should_prompt () { prompt_merge=$(git config --bool mergetool.prompt || echo true) prompt=$(git config --bool difftool.prompt || echo $prompt_merge) - if test "$prompt" = true; then + if test "$prompt" = true + then test -z "$GIT_DIFFTOOL_NO_PROMPT" else test -n "$GIT_DIFFTOOL_PROMPT" @@ -37,26 +38,35 @@ launch_merge_tool () { # $LOCAL and $REMOTE are temporary files so prompt # the user with the real $MERGED name before launching $merge_tool. - if should_prompt; then + if should_prompt + then printf "\nViewing: '$MERGED'\n" - if use_ext_cmd; then - printf "Hit return to launch '%s': " \ + if use_ext_cmd + then + printf "Launch '%s' [Y/n]: " \ "$GIT_DIFFTOOL_EXTCMD" else - printf "Hit return to launch '%s': " "$merge_tool" + printf "Launch '%s' [Y/n]: " "$merge_tool" + fi + if read ans && test "$ans" = n + then + return fi - read ans fi - if use_ext_cmd; then + if use_ext_cmd + then + export BASE eval $GIT_DIFFTOOL_EXTCMD '"$LOCAL"' '"$REMOTE"' else run_merge_tool "$merge_tool" fi } -if ! use_ext_cmd; then - if test -n "$GIT_DIFF_TOOL"; then +if ! use_ext_cmd +then + if test -n "$GIT_DIFF_TOOL" + then merge_tool="$GIT_DIFF_TOOL" else merge_tool="$(get_merge_tool)" || exit