X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=git-difftool--helper.sh;h=8452890be974d30942f0acaa3f19282c1b8b25b2;hb=8d19b44b316411d6e3a90db257a4901580603884;hp=0594bf7ca54c6b91d5f96dd86d8962e93459d004;hpb=b985f2aecaa6358b55d545385d0624d76ff83fb8;p=git.git diff --git a/git-difftool--helper.sh b/git-difftool--helper.sh index 0594bf7ca..8452890be 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,9 +38,11 @@ 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 + if use_ext_cmd + then printf "Hit return to launch '%s': " \ "$GIT_DIFFTOOL_EXTCMD" else @@ -48,7 +51,8 @@ launch_merge_tool () { read ans fi - if use_ext_cmd; then + if use_ext_cmd + then export BASE eval $GIT_DIFFTOOL_EXTCMD '"$LOCAL"' '"$REMOTE"' else @@ -56,8 +60,10 @@ launch_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